Skip to content

Instantly share code, notes, and snippets.

@vajrasar
Last active August 29, 2015 13:56
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 vajrasar/8840059 to your computer and use it in GitHub Desktop.
Save vajrasar/8840059 to your computer and use it in GitHub Desktop.
Body Class is only applying on main-page.php and not on list-page.php
<?php
//* Add custom body class to the head
add_filter( 'body_class', 'sk_body_class' );
function sk_body_class( $classes ) {
if ( is_page_template( 'list-page.php' ) || is_page_template('main-page.php') || is_archive() )
$classes[] = 'masonry-page';
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment