Created
January 7, 2014 06:18
-
-
Save quangbahoa/8295349 to your computer and use it in GitHub Desktop.
//Add archive class to body tag of specific page templates (those that work as archives)
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
//Add archive class to body tag of specific page templates (those that work as archives) | |
function add_archive_classes_to_page_templates($classes) { | |
if (is_page_template('news.php')) { | |
$classes[] = 'archive'; | |
} | |
return $classes; | |
} | |
add_filter('body_class', 'add_archive_classes_to_page_templates') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment