/ Published in: PHP
The php if statement below checks to see if the content is an archive page. If it is, then it echoes the html structure for meta description tags and also includes the month and year to avoid content duplication.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php if (is_month()) {echo '<meta name="description" content="'; the_time('F, Y'); echo ' archive page for Electric Mohawk."/>';}?>
URL: http://www.brettwidmann.com/2012/01/add-meta-description-to-archives-wordpress/