-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path404.php
66 lines (59 loc) · 2.59 KB
/
404.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="error">
<head>
<title>出错了,这里是404</title>
<?php $options = get_option('loper_options'); ?>
<?php
if (is_single()) {
if ($post->post_excerpt) {
$description = $post->post_excerpt;
} else {
$description = cut_str(strip_tags(
apply_filters('the_content',$post->post_content)
),220);
}
$keywords = "";
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag ) {
$keywords = $keywords . $tag->name . ",";
}
} else if (is_category()) {
$description = category_description();
}
?>
<meta name="keywords" content="<?php if (is_home()) { echo ($options['keyword_content']);} else echo $keywords;?>" />
<meta name="description" content="<?php if (is_home()) { echo ($options['description_content']);} else echo $description;?>" />
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php if( is_home() ){ ?>
<link rel="canonical" href="<?php bloginfo("url"); ?>" />
<?php } ?>
<link rel="index" title="<?php bloginfo( 'name' ); ?>" href="<?php echo get_option('home'); ?>/" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--网站图标-->
<link rel="Shortcut Icon" href="<?php bloginfo('template_directory');?>/images/favicon.ico" type="image/x-icon" />
<?php if($options['feedrss'] && $options['feedrss_content']) : ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php echo($options['feedrss_content']); ?>" />
<?php else : ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'rss2_url' ); ?>" />
<?php endif; ?>
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'atom_url' ); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<?php if($options['headcode']) : ?>
<?php echo($options['headcode']); ?>
<?php endif; ?>
<?php wp_head(); ?>
<?php if ( is_singular() ){ ?>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/comments-ajax.js"></script>
<?php } ?>
</head>
<body class="errorbg">
<div class="errorpic">
</div>
<div class="errorfooter">
<p><a href="<?php echo home_url('/');?>/"><strong>Go back home!</strong></a></p>
<p><a href="<?php echo get_option('home');?>/"><?php bloginfo('name');?></a> , Powered by <a href="http://wordpress.org/">WordPress <?php bloginfo('version');?></a></p>
<!--<?php echo get_num_queries();?> queries. <?php timer_stop(1);?> seconds. -->
</div>
<?php wp_footer(); ?>
</body>
</html>