Last active
December 18, 2015 02:29
-
-
Save anthonycole/5711755 to your computer and use it in GitHub Desktop.
Add a class to every page that isn't a homepage in WordPress.
This file contains hidden or 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 | |
// put this in your functions.php file. | |
add_filter('body_class', 'five15_body_classes'); | |
function five15_body_classes($classes) { | |
if( !is_front_page() ) | |
$classes[] = 'not-home'; | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
damn that looks straight forward - dumb obvious question what in the css am i calling that class?
all i'm doing is post title justified right on front page, but on post page i want it justified centre. Reason being on front page, feature 3 posts have feature image justified left.