How to add get category of the post the homepage
-
basically, i have post/articles in the homepage in different category and i want to put some badge/violator or get the categiry saying if this post is in this category their is custom badge/violator. i tried to do this in if else or foreach loop.
if(is_home() || in_category(‘celebrity’)) {?>
echo’Trending’;
<?php } else { ?>
echo’Not Trending’;
<?php } } else { ?><?php }?>
- The topic ‘How to add get category of the post the homepage’ is closed to new replies.