Home:
1)If you set keywords and description in option2 and option3,the content will be displayed in Home head meta;
2)If you leave they blank, the blogname and blogtagline(blogdescription) will be keywords and description instead;

Single:
1)In default, the tags for the single will be keywords, and some of single post content will be description;
2)If add two custom fields for the single post, one key is keywords, another key is description, their content will be keywords and description in single head meta instead;
3)If the post excerpt of the single is not blank, the content will be description in single head meta;
4)If no tags for the single, the post title will be keywords instead;

Page:
1)If add two custom fields for the page, one key is keywords, another key is description, their content will be keywords and description in page head meta;
2)otherwise, the page title and blog name will be keywords, and some of the page content will be description instead;

Category:
1)In default, the cat name and cat_description will be keywords and description in category head meta;
2)If cat_description is blank, the cat name and blogtagline(blogdescription) will be description instead;

Tag:
1)In default, the tag name and tag_description will be keywords and description in tag head meta;
2)If tag_description is blank, the tag name and blogtagline(blogdescription) will be description instead;','awsp'); ?>



cat_name;} if(is_single() || is_page()) { $post = $wp_query->post; $post_custom = get_post_custom($post->ID); $custom_desc_value = $post_custom["$custom_desc_key"][0]; $custom_keyw_value = $post_custom["$custom_keyw_key"][0]; if($custom_desc_value) { $descr = trim(strip_tags($custom_desc_value)); } elseif(!empty($post->post_excerpt)) { $descr = $post->post_excerpt; } else { $descr = $post->post_content; } $descr = str_replace(array("\r","\n"), " ", $descr); $descr = trim(strip_tags($descr)); $descr= explode(' ', $descr); $count=count($descr); if($count > $enpost_desc_length) { $l = $enpost_desc_length; $ellipsis = '¡­¡­'; } elseif ($count > $zhpost_desc_length){ $l = $zhpost_desc_length; $ellipsis = '¡­¡­'; } else { $l = $count; $ellipsis = ''; } $description = ''; for ($i=0; $i<$l; $i++) $description .= $descr[$i] . ' '; $description .=$ellipsis; if(is_single()){ $keywords=''; $tags = wp_get_post_tags($post->ID); foreach ($tags as $tag ) { $keywor[]=$tag->name;}if ($keywor==''){$keywords=$post->post_title;}else{ $keywords=implode(",",$keywor);} } elseif($custom_keyw_value) { $keywords = trim(strip_tags($custom_keyw_value)); } else { if ($options['bname']){ $keywords=$post->post_title.','.strip_tags($boname);}else{ $keywords=$post->post_title; }} } elseif(is_category()) { if ($options['bname']){ $keywords= $key.','.strip_tags($boname);}else{$keywords= $key;} $category = $wp_query->get_queried_object(); $description = trim(strip_tags($category->category_description));if($description==""){$description=$key .",". trim(strip_tags(get_option('blogdescription')));} } elseif(is_tag()) { $tag= $wp_query->get_queried_object(); if ($options['bname']){ $keywords= $tag->name.','.strip_tags($boname);}else{$keywords= $tag->name;} $tag = $wp_query->get_queried_object(); $description = trim(strip_tags($tag->tag_description));if($description==""){$description=$tag->name .",". trim(strip_tags(get_option('blogdescription')));} } else { if ($options['gt_keywords'] && $options['gt_keywords_content']){ $keywords=($options['gt_keywords_content']);}else{$keywords=get_option('blogname');} if ($options['gt_description'] && $options['gt_description_content']){ $description=($options['gt_description_content']);}else{$description=trim(strip_tags(get_option('blogdescription')));} } if($keywords){echo"\n";} if($description) { echo "\n"; } } add_action('wp_head', 'gt_keyw_descr'); ?>