Skip to content

Instantly share code, notes, and snippets.

@quangbahoa
Created January 7, 2014 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quangbahoa/8295349 to your computer and use it in GitHub Desktop.
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)
//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