Reputation: 451
How to add class on body for certain page and that class to be visible for all languages for that page, because my side running on 7 languages?
For example if I have page About us on her body I want to add class and to be visible for other languages for page About us?
I
Upvotes: 1
Views: 2644
Reputation:
Sample code:
if ( is_page( 'your-page-slug' ) ) {
add_filter( 'body_class', function( $classes ) {
return array_merge( $classes, array( 'class-name' ) );
} );
}
Upvotes: 2