• I have 3 menus on my site. For one page I would to remove all the pages in the header nav and have nothing but the header background display.
    I tried this but it did not work, I receive a syntax error:
    <div id=”navigation”>
    <?php
    if (is_page(‘institutional-investors)){
    // do nothing }
    else {
    <?php wp_nav_menu(‘theme_location=header-menu&fallback_cb=&container=’); ?>
    }
    ?>
    Thanks,
    Mary-Ellen

    <div class=”cl”> </div>

    </div>

Viewing 9 replies - 1 through 9 (of 9 total)
  • if (is_page(‘institutional-investors’)){

    your missing a closing quote on the reference maybe?

    Thread Starter mvmedia

    (@mvmedia)

    thanks so much, but I fixed that after I posted and saw it, still getting a parse error.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Look carefully at where you’re opening and closing the PHP. It doesn’t make sense.

    Thread Starter mvmedia

    (@mvmedia)

    Andrew, thanks. working on reworking the statement.

    Thread Starter mvmedia

    (@mvmedia)

    how can i perform a function if it’s a certain page?
    I only know enough php to get by and I can’t find a reference. Can you please help?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Just as you were doing before:

    if (is_page('institutional-investors')){
     // Do your stuff
    }

    with the ‘else’ part:

    <?php
    if ( is_page( 'institutional-investors' ) ) {
    // do nothing
    } else {
    wp_nav_menu('theme_location=header-menu&fallback_cb=&container=');
    }
    ?>
    Thread Starter mvmedia

    (@mvmedia)

    thanks that did, somehow I was making another mistake!
    I appreciate your help.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What code are you using?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Stop nav menu on a certain page’ is closed to new replies.