• Resolved mbarrio

    (@mbarrio)


    if ( has_nav_menu( 'primary' ) ) {
    
    			$args = array(
    				'theme_location' => 'primary',
    				'container' => '',
    				'menu_class' => genesis_get_option('nav_superfish') ? 'nav superfish' : 'nav',
    				'link_after' => '<span class="navpipe">|</span>',
    				'echo' => 0
    			);
    
    			$nav = wp_nav_menu( $args );
    
    		}

    So as you can see I’ve added a pipe to the menu, unfortunately this is adding to the sub-menu items also. I know you can run conditionals inside an array but each attempt I’ve made has broken something. How would I say:
    if top-level then add 'pipe' else ''
    I do not want to remove the sub-menus I just do not want the sub-menus to have the link_after

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • You may be better off using CSS to add pipes. Often it’s accomplished with a background image or li:after {content: “|”}.

    Thread Starter mbarrio

    (@mbarrio)

    Wow I cannot believe I had so over-complicated that. I think I’ve been using this method for so long that I didn’t even think to see if there was another solution.

    I did see this on the w3 website for future users of the ‘content’ css element:

    IE8 only supports the content property if a !DOCTYPE is specified.

    Thanks, jevets!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Advanced Menu Question for link_after’ is closed to new replies.