Preventing a tag from displaying…
-
I’m attempting to place a condition within the code of my second sidebar. If the first post on my index.php is in a specific category, then content in the sidebar should be relevant to that category. I managed to achieve this using a simple if statement but the tag that I’m checking, which is the_category_ID() also causes the category number to print out.
<?php if (the_category_ID() == 26) { do this } ?>
Well, the “do this” works, but the category ID is also displayed. Can I mask from showing up?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Preventing a tag from displaying…’ is closed to new replies.