Created
August 30, 2012 03:22
-
-
Save bondarolik/3522002 to your computer and use it in GitHub Desktop.
Custom keywords including tags and category list within (hardcoded in header.php)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name='keywords' content='<?php echo $keywords; ?>' /> | |
<meta name='description' content='<?php echo $description; ?>' /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Add to top | |
# Should be in theme options as functions | |
$keywords = "define, here, your, default, seo, keywords"; | |
if (is_home()) { | |
$description = get_bloginfo('description'); | |
} else if (is_single()) { | |
$description = $post->post_title; | |
$tags = wp_get_post_tags($post->ID); | |
foreach ($tags as $tag ) { | |
$tagslist .= $tag->name . ", "; | |
} | |
$keywords = $keywords.", ".$tagslist; | |
} | |
else if (is_category()) { | |
$description = category_description(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment