Forums

In_category strangeness (3 posts)

  1. rumlab
    Member
    Posted 1 year ago #

    Hello. I'm very puzzled by the simple thing.

    I have this in my loop:

    <?php if (in_category('design')); {
    	echo '<b>Design</b>';
    }
    ?>

    And surely it echoes "Design" in bold, but is does it in every category (single.php). I also tried:

    <?php if ((is_single()) && (in_category('design'))); {
    	echo '<b>Design</b>';
    }
    ?>

    But with the same result.

    What's going on?

    Thanks

  2. duck__boy
    Member
    Posted 1 year ago #

    Get rid of the colon at the end of the if statement.

  3. rumlab
    Member
    Posted 1 year ago #

    Haha. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic