Skip to content

Instantly share code, notes, and snippets.

@hendrysadrak
Created August 6, 2014 10:25
Show Gist options
  • Save hendrysadrak/87ffdc42782f35a95c0c to your computer and use it in GitHub Desktop.
Save hendrysadrak/87ffdc42782f35a95c0c to your computer and use it in GitHub Desktop.
Wordpress - check if class exists in body class array
<?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