How to request container_class from wp_nav_menu

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 ? str_repeat( “\t”, $depth ) : ” ); // code indent // … Read more

Show Sidebar Menu Subpages When Clicking Parent

No need for a custom walker – it’s controlled with the depth parameter. At the moment, you’re only showing 2 levels of menus – but you need to set this to 3! This, however, will only control what is being output. As for the user clicking, hovering or otherwise to actually see the menu, you’ll … Read more

How to change the menu mark up with walker_nav_menu class?

I just posted an answer to this here: How to create this custom menu walker? Basically, you want your start_el and end_el to looks something like this: function start_el(&$output, $item, $depth=0, $args=array()) { $output .= ‘<a href=”#”><span>’ . esc_attr($item->label); } function end_el(&$output, $item, $depth=0, $args=array()) { $output .= ‘</span></a>’; }

Custom menu walker – remove li tag based on class name

Do you have error logging on? If you’re running the latest version of WP, this should be throwing an error because start_el and end_el are public functions. Also, if you’re using a custom walker, you should only use the walker and not your additional theme_function. class wpseWalker extends Walker_Nav_Menu { public function start_el(&$output, $item, $depth … Read more

Creating Custom navigation in wordpress with sub menus

Here is your walker class class Description_Walker extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat(“\t”, $depth); $output .= “\n$indent<nav class=”dropdown-list w-dropdown-list”>\n”; } function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $classes = empty($item->classes) ? array () : (array) $item->classes; … Read more

wp_nav_menu: Is there a way to modify the output of that got a submenu?

You should be able to use nav_menu_link_attributes to add attributes to links output by wp_nav_menu that have child/submenu links. wp_nav_menu conditionally assigns classes to links it outputs. You need to target links with the class .menu-item-has-children You can add the attributes you want with the following filter/function: add_filter( ‘nav_menu_link_attributes’, ‘wpse270596_add_navlink_atts’, 10, 3 ); function wpse270596_add_navlink_atts( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)