Walker nav remove submenu ul from a certain depth

At first glance, and without testing anything, the code you’ve got should work but I expect that you have a number of spurious </ul> in your markup. You need to do nearly the same thing for the end_lvl method. function end_lvl(&$output, $depth) { if($depth >= 2) { $output .= ”; } else { $output .= … Read more

Primary and secondary menus

I am guessing you are gonna use pages or categories in the primary menu. The following code would need to be altered to work for custom taxonomies ( should work fine with custom post types also ). Put the following code in your themes functions.php: function km_dynamic_secondary_menu_reg() { global $km_nav_menus; $theme_location = ‘primary’; // replace … Read more

Custom menu walker: how can i check first item

Count the level 0 elements in a static variable in the method and add an extra class if you hit the third. Sample code: function start_lvl(&$output, $depth) { static $column = 1; $indent = str_repeat(“\t”, $depth); if ($depth > 0) { $output .= “\n$indent<ul class=”subsubmenu”>\n”; } else { $column += 1; $extra = 3 === … Read more

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