Support » Theme: Bootstrap Canvas WP » Just one level of submenu?

  • Alex Seidanis

    (@beerallica)


    Hello,

    I have a category tree that is 3 levels deep, but the menus seem to only go as far as the first level, then ignore anything deeper than that. Here’s an example of my tree:

    LEVEL 0
      level 1
        level 2
        level 2
          level 3
        level 2

    and here’s what’s been shown on the menu:

    LEVEL 0
      level 1

    Changing the ‘depth’ argument in wp_nav_menu() where the menu appears doesn’t seem to work. What am I missing please?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Sampression

    (@sampression)

    Hello Beerallica,

    You might need to add script to fix this on “/themes/YOUR_THEME_FOLDER/js/scripts.js”.

    $(".dropdown-menu > li.menu-item-has-children > a").on("click",function(e){
    		var current=$(this).next();
    		var grandparent=$(this).parent().parent();
    		if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))
    			$(this).toggleClass('right-caret left-caret');
    		grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret');
    		grandparent.find(".sub-menu:visible").not(current).hide();
    		current.toggle();
    		e.stopPropagation();
    	});
    	$(".dropdown-menu > li:not(.menu-item-has-children) > a").on("click",function(){
    		var root=$(this).closest('.dropdown');
    		root.find('.left-caret').toggleClass('right-caret left-caret');
    		root.find('.sub-menu:visible').hide();
    	});

    Thanks,
    Sampression

    Alex Seidanis

    (@beerallica)

    Thank you Sampression.
    I did, but it didn’t help; the menu is still 1 level deep.

    Sampression

    (@sampression)

    Hi @beerallica,

    Do you have a dev / demo setup, can you please send me the link.

    I would be happy to take a look at that.

    Thanks,
    Sampression

    Alex Seidanis

    (@beerallica)

    Why, yes, here it is: tastefull.gr.
    Not a demo, but it just went online. I have created the illusion of multilevel menus using CSS, but that’s not quite what I had in mind.

    if I add that JS from above, where does that get called from the template? From the functions page?

    Yup. The line
    wp_enqueue_script( 'scripts-js', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ), '', true );
    is already there in the parent theme, look for it.

    Theme Author Schon Garcia

    (@schongarcia)

    Just updated the theme to include more depths. Thanks for the input and sorry about the delay.

    Congrats dude; you just broke all the sites that were using the old version.

    You should at least have left the bootstrap navwalker there for backwards compatibility.

    For those striving to get their website back to a functional state after upgrading to 1.97, here’s the solution:

    1. Download the bootstrap navwalker from github.

    2. Upload it to your child theme’s folder

    3. Then, open your child theme’s functions.php and add the following lines:

    
    if ( ! function_exists( 'naxos_setup' ) ):
      function naxos_setup() {
    
        // Register Custom Navigation Walker
        require_once('wp_bootstrap_navwalker.php');
    }
    add_action( 'after_setup_theme', 'naxos_setup' );
    endif;
    

    Done. Your site should now be working.
    The submenu level problem has come back though, but now you have the time to examine the 1.97 code changes and make any changes to your child theme.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Just one level of submenu?’ is closed to new replies.