WordPress if condition for category single post

Question

I am trying to add something for selected category single post. Here is the code i tried

<?php if (is_single() && in_category(array('category id'))) { echo 'here is content'; } ?>

i even tried category name as well, but did not work.

0
firekid2018 4 months 0 Answers 13 views 0

Leave an answer