Support » Theme: Iconic One » Show different menus to logged in users

  • Resolved nRaphy

    (@nraphy)


    Hello

    I’m trying to have multiple menus for the same location when people are registered or not.

    According to this website : http://www.wpbeginner.com/wp-themes/how-to-show-different-menus-to-logged-in-users-in-wordpress/

    I changed my functions.php

    if ( ! isset( $args['show_home'] ) )
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'themonic_page_menu_args' );

    with

    if( is_user_logged_in() ) {
    $args['menu'] = 'logged-in';
    } else {
    $args['menu'] = 'logged-out';
    }
    return $args;
    }
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

    but it doesn’t work. Any idea?!

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show different menus to logged in users’ is closed to new replies.