G Gon Active Member 538 2014 149 14,160 Sep 14, 2020 #1 I trying to add something for selected category single post. Here is the code i tried PHP: <?php if (is_single() && in_category(array('category id'))) { echo 'here is content'; } ?> i even tried category name as well, but did not work. Last edited: Sep 14, 2020
I trying to add something for selected category single post. Here is the code i tried PHP: <?php if (is_single() && in_category(array('category id'))) { echo 'here is content'; } ?> i even tried category name as well, but did not work.
G Gon Active Member 538 2014 149 14,160 Oct 1, 2020 #3 problem fixed. category name and id both will work. i made some mistake