• Rachel Goldstein

    (@rachelgoldstein71)


    I am trying to show category-specific banners. I want a category’s banner to show up whether you’re on a category archive OR on a post within a category. I am having trouble constructing the IF statement. It is outside the loop, in the header code.

    I thought I could use:
    <?php if (is_category('city')) || in_category('city')) : ?>
    But only the first part of that statement has any effect.

    Any ideas?
    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • stephencottontail

    (@stephencottontail)

    You’ve got one too many closing parentheses in the first part of the statement. It should look like this:

    <?php if (is_category('city') || in_category('city')) : ?>

    Thread Starter Rachel Goldstein

    (@rachelgoldstein71)

    Aha! Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using is_category and in_category together’ is closed to new replies.