New answers tagged

0

Simply try to move in menu settings "menu voices"(pages as :home, who we are, what to do, etc) alling them one under another.


0

Go with a custom Walker class Your_Walker_Nav_Menu extends Walker_Nav_Menu { var $container_class; public function __construct($container_class) { $this->container_class = $container_class; } function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $wp_query; $indent = ( $depth > ...


0

So far i've tried pulling the value from the nav template. https://github.com/WordPress/WordPress/blob/master/wp-includes/nav-menu-template.php. I know it's related to $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-'. $menu->slug .'-container"'; on line 353. The value returns null when ...


0

If you want to build your own custom nav menu you should be extending the Walker_Nav_Menu class, not the Walker class. When building a custom menu walker the $db_fields should be what the default Walker_Nav_Menu class has: $db_fields = array ('parent' => 'menu_item_parent', 'id' => 'db_id'); When building the navigation link for a menu item, the ...


0

The WordPress native Walker class doesn't pass the arguments you need to the start_lvl() method. So to do this, you will need to add a custom display_element() method to your custom walker. You can use most of the original, with something similar to the commented section below: public function display_element( $element, &$children_elements, $max_depth, ...



Top 50 recent answers are included