Created
October 12, 2020 12:36
-
-
Save ajmaurya99/0da89a83678b20953701e2ba7cbb5bb3 to your computer and use it in GitHub Desktop.
WordPress add class to body tag for all the pages.
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
add_filter('body_class', 'wp_body_class'); | |
function wp_body_class($class) | |
{ | |
$class[] = 'my-custom-class'; // Add your class name here. Multiple class names can be added 'classname1 classname2'. | |
return $class; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment