CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
PHP Problems
Correct syntax for using more than one conditional tag
EamonnMac
Permalink to comment
#
August 2009
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!
falkencreative
Permalink to comment
#
August 2009
"And" uses "&&"
<? php if (is_home() && is_category('3')
http://us3.php.net/manual/en/control-structures.if.php
EamonnMac
Permalink to comment
#
August 2009
Sweet. Thanks man.
Add a Comment
<? 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!
<? php if (is_home() && is_category('3')http://us3.php.net/manual/en/control-structures.if.php