• Resolved Jordan

    (@theoriginaljordan)


    Hello All,

    I am trying to make the logo in my header change
    if the category is set to a specific category.

    I have three different logos I need to cycle through.
    One appears if is_category('one')
    Two appears if is_category('two')
    The third I want to show up neither of these are true.

    I apologize for my ignorance. I am new to the php/wordpress world.

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jordan

    (@theoriginaljordan)

    This will probably make it easier to help me out.

    <?php if ( is_category( 'athome' ) ) { ?>
    <img src = "https://images/logo1.png" />
    <?php } else ( is_category( 'whirlweddings' ) ) { ?>
    <img src = "https://images/logo2.png" />
    <?php } else () ) { ?>
    <img src = "https://images/logo3.png" />
    <?php } ?>

    Try this:

    <?php if ( is_category( 'athome' ) ) { ?>
    <img src = "https://images/logo1.png" />
    <?php }
    elseif ( is_category( 'whirlweddings' ) ) { ?>
    <img src = "https://images/logo2.png" />
    <?php }
    else { ?> <img src = "https://images/logo3.png" />
    <?php } ?>

    Thread Starter Jordan

    (@theoriginaljordan)

    I actually just figured it out. It due to my if else statement.

    The proper order was
    if, elseif, else

    Thread Starter Jordan

    (@theoriginaljordan)

    Thanks anyway Harrison, sorry to have wasted you’re time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘is_category question.’ is closed to new replies.