• Since I updated to WP 4.0, my coding for when a user logsin to my site and the menu changes has stopped working. Can anyone help edit it or suggest what to do to fix? Thanks!

    In header.php (child)

    <?php
    if( is_user_logged_in() ) {
    $menu = ‘logged-in’;
    } else {
    $menu = ‘logged-out’;
    }

    wp_nav_menu( array( ‘menu’ => $menu, ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) );
    ?>

    The article I got the code from: https://www.butlerblog.com/2011/11/21/show-menu-based-on-wordpress-login-status/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twenty Eleven – Menu Nav Roles’ is closed to new replies.