Customize existing menu item

Given that you want to include a picture in the wp_nav_menu output, your best bet is to use the wp_nav_menu_items filter, as suggested in the comments. This will allow you to do a search and replace on the html. add_filter (‘wp_nav_menu_items’,’wpse229358_filter_menu’); function wpse229358_filter_menu ($items,$args) { $search=””; // html string of button $replace=””; // html string … Read more

Walker menu not displaying at all

The walker code is okay, but in order to have this markup: <ul class=”nav navbar-nav” data-in=”fadeInDown” data-out=”fadeOutUp”> … </ul> ..in the array passed to the wp_nav_menu() function, set items_wrap to: <ul id=”%1$s” class=”%2$s” data-in=”fadeInDown” data-out=”fadeOutUp”>%3$s</ul> So the full markup would be: <div class=”collapse navbar-collapse” id=”navbar-menu”> <?php wp_nav_menu( array( ‘menu_class’ => ‘nav navbar-nav’, ‘container’ => ”, … Read more

Manual use of Walker_Category class

the Walker_Category class you are using requires 3 params in walk() method, the third param will be use_desc_for_title value (this is due to how Walker_Category::start_el() method is written). In other words, to use the walk() method without generating a notice you should change your last line to print_r( $walk->walk( $menu_items, -1, -1 ) ); The … Read more

How to remove dropdown from wp_nav_menu

We can use depth parameter of wp_nav_menu to set how many levels menu walker traverses. wp_nav_menu( array( ‘menu_id’=>’nav’, ‘theme_location’=>’header-menu’ , ‘depth’ => 1) ); You can create a child theme so that updates won’t override during updates. Create child theme and copy code from header.php of parent theme then replace the code wp_nav_menu( array( ‘menu_id’=>’nav’, … Read more

How to actually make menu walker alive on admin interface?

You use the walker in your theme, wherever you call your nav menu. So for example, if you currently have a “topnav” menu in your theme, like this: wp_nav_menu(array(‘menu’ => ‘topnav’); and your custom walker is called “myCustomWalker”, you would update the wp_nav_menu call like this: wp_nav_menu( array( ‘menu’ => ‘topnav’, ‘walker’ => new myCustomWalker() … Read more

How to add attribute in menu code

If you want WordPress to add these items dynamically you would need to add a custom walker class to your menu declaration. Find where your menu is declared in the theme and add a custom walker class name in their wp_nav_menu function: wp_nav_menu( array ( ‘menu’=> ‘main-menu’, ‘container’=> ”, ‘walker’ => new Description_Walker)); The menu … Read more

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