Forums

Preventing a tag from displaying... (3 posts)

  1. arretx
    Member
    Posted 1 year ago #

    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?

  2. twofiverthreetwo
    Member
    Posted 1 year ago #

    Try the_category_ID('false') and see if that doesn't fix the problem.

  3. arretx
    Member
    Posted 1 year ago #

    Thanks. I have abandoned the_category_ID since it was deprecated and have implemented the proper syntax.

    Thanks for the solution though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.