• I know this is silly, but perhaps someone can guide me in the right direction. What i’m looking for is a way to determine if I am on a certain page within the If Statement.

    Here’s an example of what I’m trying to do (which obvious won’t work but just to give you an idea) this is within a function:

    if (is_page( array( 11, 21, 30 ) )) {
              echo "<ul> <li" . if is_page( 21 ) { echo 'class=\"current\"' . "><a href=\"/about-us/management-team/\" title=\"Management Team\">Management Team</a></li>
    		<li" . if is_page( 30 ) { echo 'class=\"current\"' . "><a href=\"/about-us/our-partners/\" title=\"Our Partners\">Our Partners</a></li>
    		</ul>";
    } else if {...
Viewing 4 replies - 1 through 4 (of 4 total)
  • if ( is_page( '11') || is _page ('21' ) || is_page( '30' ) ) :
    $class = ' class="current"';
    else $class = '';?>
    <ul><li<?php echo$class;?>>
    <a href="https://example.com/about-us/management-team/" title="Management Team">Management Team</a></li>
    <li<?php echo$class;?>><a href=https://example.com/about-us/our-partners/" title="Our Partners">Our Partners</a></li>
    </ul>
    elseif:
    [...]
    endif;
    Thread Starter jcalabro

    (@jcalabro)

    @esmi:
    Thank you for your reply! I was trying to keep everything within function.php, but I guess I’ll have to go this route and place in the template

    It should still be possible to integrate the above code into a function.

    Thread Starter jcalabro

    (@jcalabro)

    Thanks! I’ll give it a shot

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘If statement with an If statment’ is closed to new replies.