The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Correct syntax for using more than one conditional tag

  • # August 17, 2009 at 5:31 pm

    Hey guys, quick query – I’ve googled this but everyone seems to deal with just the ‘or’ or ‘else’ aspects of conditional tags, for example :

    <? php if (is_home() || is_category(‘3’)

    …being ‘if this is the home page or category 3 then…

    With the is_home and in_category tags, what is the correct syntax for writing ‘if this is the home page and in category 3 then…etc.?

    Thanks in advance!

    # August 17, 2009 at 8:13 pm

    "And" uses "&&"

    < ? php if (is_home() && is_category('3')

# August 17, 2009 at 9:52 pm

Sweet. Thanks man.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed