How to add a submenu toggle button inside all “li” elements that have a submenu?

I managed to solve this: Create the function So I created a new custom walker function in functions.php and copied all the code of the core wp nav walker function (wp-includes/class-walker-nav-menu.php). Check for a menu item that has children I then added this array_search in public function start_el to check if the parent element has … Read more

Editing WordPress Nav Menu Walker

You need create additional field for menu item. Because if you will use class field – you will block adding additional class to links. But if it’s ok – create <i class=”$your_class”></i> before link title. And @Dilip Gupta gave solution to you.

Third level navigation class

You don’t need to write your custom Walker for that… Let’s take a look on built-in Walker_Nav_Menu. You’ll find this function: public function start_lvl( &$output, $depth = 0, $args = array() ) { if ( isset( $args->item_spacing ) && ‘discard’ === $args->item_spacing ) { $t=””; $n = ”; } else { $t = “\t”; $n … Read more

Removing from Comment

wp_list_comments() accepts a walker in the array of its first parameter. This is a class that renders the output. If you don’t provide one, the default class will be used, Walker_Comment. You can find it in wp-includes/comment-template.php. To change the complete comment list out, create a custom walker in your functions.php which extends the default … Read more

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

Use wp_nav_menu to display ALL pages

You could move away from wp_nav_menu() completely and instead use wp_list_pages(). See the codex for more information, but I believe this may be what you are looking for. http://codex.wordpress.org/Function_Reference/wp_list_pages I do understand that this function outputs the pages. The point I was trying to make though is that you can use this in conjunction with … Read more

Counting top level items in a custom menu walker

Calculation you talking about going here: if( !isset( $this->break_point ) ) $this->break_point = ceil( $this->current_menu->count / 2 ) + 1; You can’t get top-level items count this way. Instead you should count it yourself. You can do this using wp_get_nav_menu_items(). Every top-level item should have menu_item_parent set to ‘0’. You should create additional variable where … Read more

Adding post excerpt into navigation menu

wp_nav_menu() calls walk_nav_menu_tree() which calls the Walker_Nav_Menu class. There are a couple of filters you can hook into in those functions but I would take a look at the nav_menu_item_title filter in the Walker_Nav_Menu class. Here is the source: /** * Filter a menu item’s title. * * @since 4.4.0 * * @param string $title … Read more

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