ml92
ml92

Reputation: 451

Add class on body in Wordpress

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

Answers (1)

user2284357
user2284357

Reputation:

Sample code:

if ( is_page( 'your-page-slug' ) ) {
   add_filter( 'body_class', function( $classes ) {
       return array_merge( $classes, array( 'class-name' ) );
   } );
}

Reference of filter.

Upvotes: 2

Related Questions