Support » Plugins and Hacks » Hacks » Alternate menu (php IF statement) help

  • Resolved Wpaul63

    (@wpaul63)


    I’ve installed the splashgate plugin in order to create a disclaimer page that the user must access before gaining access to the sensitive information. This also means hiding the main nav menu until the user has agreed to the disclaimer / TOS.
    The “if” statement should be quite straightforward but I keep on geting a “unexpected T_IF” error on line 86 (where I test for the page ID). i know the error must be glaring, but I can’t find it…
    Can anyone point me into the right direction?

    <? php
    				if ( is_page('35547')
    				{php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'vuoto' ) );
    				}
    				else if
    				{php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) );
    				}
    				endif;
    				 ?>

    Thx

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    general syntax problems –
    a broken php start tag; brackets in the if statement; php fragments inside the { ; else if instead of else; (false endif in connection with } syntax (unless the endif is part of an unposted section of the code ?);

    hopefully corrected below:

    <?php
    				if ( is_page('35547') )
    				{ wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'vuoto' ) );
    				}
    				else
    				{ wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) );
    				}
    ?>

    Thank you it worked – a round of applause and a beer if you ever visit southern Switzerland 🙂

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Alternate menu (php IF statement) help’ is closed to new replies.