Created
August 6, 2014 10:25
-
-
Save hendrysadrak/87ffdc42782f35a95c0c to your computer and use it in GitHub Desktop.
Wordpress - check if class exists in body class array
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 | |
function isBodyClass($classToSearchFor) { | |
$classes = get_body_class(); | |
return in_array($classToSearchFor, $classes); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment