Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
//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