Last active
February 14, 2024 10:35
-
-
Save jaapmarcus/5f0755b548f59dc35d1e13b33492ce77 to your computer and use it in GitHub Desktop.
Extra body class
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 | |
function mimified_ads($classes) { | |
$categories = get_the_category(); | |
if(is_single()){ | |
if(!in_array($categories[0] -> term_id, array(68,69,71,50))){ | |
$classes[] = 'trending-post'; | |
} | |
} | |
return $classes; | |
} | |
add_filter('body_class', 'mimified_ads'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment