Last active
October 27, 2017 00:10
-
-
Save studiopress/5706780 to your computer and use it in GitHub Desktop.
Genesis body class.
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_category( '1' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_category( 'sample-category' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_page( '1' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_page( 'sample-page' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_tag( '1' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add custom body class | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_tag( 'sample-tag' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
category-sample.php didn't work until I changed the conditional to read
`if (in_category(blah-de-blah ...
return $classes;
}}