Last active
December 28, 2015 00:09
-
-
Save kadavre/7411319 to your computer and use it in GitHub Desktop.
WordPress does not support the use of meta description tags by default. Though metas have lost their significance in SEO, they can still influence the ranking of your blog in the search engines. To make your site search engine friendly, you should open the header.php file of your theme and copy and paste the code below to the space between the o…
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="description" content=" | |
<?php | |
if ((is_home()) || (is_front_page())){ | |
echo ('Your main description goes here'); | |
}elseif(is_category()){ | |
echo category_description(); | |
}elseif(is_tag()){ | |
echo '-tag archive page for this blog' . single_tag_title(); | |
}elseif(is_month()){ | |
echo 'archive page for this blog' . the_time('F, Y'); | |
}else{ | |
echo get_post_meta($post->ID, "Metadescription", true); | |
}?>"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment