How to get shared CSS body class between translated WPML pages

I need to add the same CSS class to element of all translatons of a page, but the CSS class added with body_class() is different for each translation because it is taken from the translated title of the page.

For example, for about us page I get this markup:

<body class=”about-us”> // English
<body class=”sobre-nosotros”> // Spanish

I want to get the same class for both languages:

<body class=”about-us”> // English
<body class=”about-us”> // Spanish

Is there a way to add the same CSS class for all translations of the same page?

Thank you.

Read more here:: How to get shared CSS body class between translated WPML pages

Leave a Reply

Your email address will not be published. Required fields are marked *