Created
June 13, 2022 14:11
-
-
Save runezero/fdb7e15b7182e8d5f2e2fc10b929af69 to your computer and use it in GitHub Desktop.
[Add body css class] Add a custom body class to the WordPress website #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 | |
| // Add specific CSS class by filter. | |
| add_filter( 'body_class', function( $classes ) { | |
| $classes[] = 'dsm_body_' . get_current_blog_id(); | |
| return $classes; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment