Skip to content

Instantly share code, notes, and snippets.

@jaapmarcus
Last active February 14, 2024 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaapmarcus/5f0755b548f59dc35d1e13b33492ce77 to your computer and use it in GitHub Desktop.
Save jaapmarcus/5f0755b548f59dc35d1e13b33492ce77 to your computer and use it in GitHub Desktop.
Extra body class
<?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