If you’re running a multilingual WordPress website, providing a user-friendly language switcher is essential for enhancing user experience. WPML (WordPress Multilingual Plugin) offers several ways to integrate a language switcher, but one of the most flexible and efficient methods is through the WPML Language Switcher Shortcode. In this post, we’ll walk you through what the […]
Include category id in body_class() and post_class()
Use this code on your themes functions.php to add current category id on body and post [php] function category_id_class($classes) { global $post; foreach ((get_the_category($post->ID)) as $category) $classes[] = ‘cat-‘ . $category->cat_ID . ‘-id’; return $classes; } add_filter(‘post_class’, ‘category_id_class’); add_filter(‘body_class’, ‘category_id_class’); [/php]