ThemeShaper Forums » Thematic

[closed]

Fully expanded vertical menu

(3 posts)
  • Started 3 years ago by squidz
  • Latest reply from middlesister
  • This topic is not resolved
  1. This seems like it would have be simpmle, but we're struggling a bit on this. We're looking to create a fully open vertical menu. Meaning, the top items will be labels only, the 2nd level will be the page links. Deeper levels will be displayed in a separate sidebar sub-menu.

    We need to be just grabbing the stripped down menu list and disable/remove superfish and WP's own flyout menus.

    Has anyone done this within Thematic? Is there an easy method we're overlooking to strip the menu down to its core list so we can just style it as needed?

    Posted 3 years ago #
  2. middlesister
    Member

    You can remove the superfish class by filtering thematic_nav_menu_args. Try

    // list the arguments you want to have
    function childtheme_menu_args( $args ) {
        $args = array(
    	'menu_class'  => 'menu ', // add a class of sf-menu if you want the superfish back
    	'depth'	      => 2
        );
    return $args;
    }
    // and add the filter
    add_filter( 'thematic_nav_menu_args', 'childtheme_menu_args' );

    You can see a list of all the available parameters at http://codex.wordpress.org/Function_Reference/wp_nav_menu.

    Posted 3 years ago #
  3. middlesister
    Member

    Sorry, a better way to filter the arguments would be

    function childtheme_menu_args( $args ) {
        $args['menu_class'] = 'menu'; // use a class of sf-menu if you want to use superfish
        $args['depth'] = 2;
        return $args;
    }
    add_filter( 'thematic_nav_menu_args', 'childtheme_menu_args' );

    Then you would only change the parameters you specify, and keep the other ones that thematic has defined.

    You might also want to remove the scripts from the header with

    function childtheme_remove_superfish() {
        $superfish = false;
        return $superfish;
    }
    add_filter('thematic_use_superfish', 'childtheme_remove_superfish');

    In fact, just removing the scripts will disable superfish for you, but filtering the arguments gives you more possibilities of controlling the output of the menu, like the "depth" parameter.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.