• I am working on A website and I am kinda new to HTML/PHP and some CSS. My question is I found code to add a menu for members that are logged in and ones that are not see a different one http://www.techknot.com/4466/show-different-menu-items-to-logged-in-users.html. My issue is knowing where to put it and If I need to replace or remove any code from original code in the functions.php file. Below I posted the navigation code from file

    // Menu functions with support for WordPress 3.0 menus
    if ( function_exists('wp_nav_menu') ) {
        add_theme_support( 'nav-menus' );
        register_nav_menus( array(
    	'primary' => esc_html__( 'Primary Navigation', 'udesign' ),
        ) );
    }
    
    function udesign_nav() {
        if ( function_exists( 'wp_nav_menu' ) )
    	wp_nav_menu( array( 'container_class' => 'navigation-menu',
    			    'container_id' => 'navigation-menu',
    			    'menu_class' => 'sf-menu',
    			    'link_before'=> '<span>',
    			    'link_after' => '</span>',
    			    'theme_location' => 'primary',
    			    'fallback_cb' => 'udesign_nav_fallback' )
    			);
        else
            udesign_nav_fallback();
    }
    
    function udesign_nav_fallback() {
        global $udesign_options;
        $menu_html = '<div id="navigation-menu" class="navigation-menu">';
        $menu_html .= '<ul class="sf-menu">';
        $menu_html .= is_front_page() ? "<li class='current_page_item'>" : "
    
    <li>";
        $menu_html .= '<a href="'.get_bloginfo('url').'"><span>'.esc_html__('Home', 'udesign').'</span></a></li>
    ';
        $menu_html .= wp_list_pages('depth=5&title_li=0&sort_column=menu_order&link_before=<span>&link_after=</span>&exclude='.$udesign_options['excluded_paged_from_menu'].'&echo=0');
        $menu_html .= '';
        $menu_html .= '</div>';
        echo $menu_html;
    }

    [In future please highlight your code and then press the “code” button before posting]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need help with menu for member and non-member’ is closed to new replies.