php - Extending an IF statement -


this question has answer here:

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; ?> 

http://php.net/manual/en/language.operators.logical.php


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -