|
以前折腾wordpress时,弄的
<?php if(is_home()) { ?><title><?php bloginfo('name');?></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index,follow,archive" />
<meta name="googlebot" content="noarchive" /><?php }?>
<?php if(is_single()) {
$keywords="";$tags = wp_get_post_tags($post->ID);foreach ($tags as $tag )
{$keywords = $keywords . $tag->name . ',';}
?><title><?php single_post_title(); ?></title>
<meta name="keywords" content="<?php echo $keywords;?>" />
<meta name="description" content="<?php echo $post->post_excerpt;?>" />
<meta name="robots" content="index,follow,noarchive" />
<meta name="googlebot" content="noarchive" /><?php } ?>
<?php if(is_page()) {?><title><?php echo wp_title('',false);echo ' - ';bloginfo('name');?></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index,follow,noarchive" />
<meta name="googlebot" content="noarchive" /><?php } ?>
<?php if(is_category()) { ?><title><?php single_cat_title();echo (' - ');bloginfo('name');?></title>
<meta name="keywords" content="<?php single_cat_title();?>" />
<meta name="description" content="<?php echo trim(category_description());?>"/>
<meta name="robots" content="index,archive,follow" />
<meta name="googlebot" content="noarchive" /><?php }?>
<?php if ( !is_category()&&is_archive()) { ?><title><?php echo wp_title('',false);echo (' Archives');echo (' - ');bloginfo('name'); ?></title>
<meta name="keywords" content="" />
<meta name="description" content="<?php echo wp_title('',false);?> "/>
<meta name="robots" content="noindex,noarchive,follow" />
<meta name="googlebot" content="noarchive" /><?php }?>
<?php if(is_search()) {?><title><?php echo get_search_query();echo ' - ';bloginfo('name');?></title>
<meta name="keywords" content="<?php echo get_search_query();?>" />
<meta name="description" content=""/>
<meta name="robots" content="noindex,noarchive,follow" />
<meta name="googlebot" content="noarchive" /><?php }?> |
评分
-
查看全部评分
|