php - Extending an IF statement -
this question has answer here:
- php if statement multiple conditions 8 answers
in wordpress want call specific secondary menu in event page called foo called. i've got beviour working using following:
<?php if (is_page('foo') ) : ?> <!-- nav html --> <?php endif; ?>
however i'd same secondary menu shown on other pages, such foo2 can call recycling of above:
<?php if (is_page('foo2') ) : ?> <!-- nav html --> <?php endif; ?>
what best way join these statements? instance doesnt work:
<?php if (is_page('foo','foo2') ) : ?>
the wordpress docs suggest example code:
<?php if (is_page('foo','foo2') ) : ?>
should work fine. http://codex.wordpress.org/function_reference/is_page
however not particularly familiar wordpress, alternative can use php's or operator
<?php if (is_page('foo') || is_page('foo2')) : ?> <!-- nav html --> <?php endif; ?>
Comments
Post a Comment