Menu is not visible in appearance

I have done a complete answer on this a while ago on SO. You can see the complete post here. For the sake of WPSE users, I have copied my answer from that post. I have not edited it, this post was originally about adding and displaying a nav menu to the footer, but the … Read more

Pass a parameter to a menu walker

As @toscho said, you can call the walker class with parameters as you did: new BEMwalker( ‘mobile’ ) The constructor of BEMwalker will take the arguments (like any other function or method in PHP) so you can access the parameter(s) via $this: class BEMwalker extends Walker_Nav_Menu { private $classes; public function __construct( $classes=”” ) { … Read more

Using string instead of object class instantiation on the walker argument breaks wp_nav_menu

Apparently custom nav menu walkers are not supported though they were supposed to be. I’m surprised this only has been discovered now. However, there is an easy fix for you to get them to work. Just add this to your theme: add_filter( ‘wp_nav_menu_args’, function( $args ) { if ( isset( $args[‘walker’] ) && is_string( $args[‘walker’] … Read more

Custom menus displaying all pages instead of set pages

It’s pretty easy then… And it works exactly how it should… You register menu ‘footer ‘ – there’s a space at the end (so you have two locations defined ‘primary’ and ‘footer ‘). And then you use it as ‘footer’ – without that space. There is no such location defined anywhere 😉

What does a walker menu mean?

Walker_Nav_Menu is the core class to handle navigation menus. You can use it to handle your navigation menu, or you can create your own children class that extends this class. If you decide to use your own class, then you must pass an instance as an argument when you use wp_nav_menu() class myWalkerClass Extends \Walker_Nav_Menu … Read more

How to var_dump nav menu items from anywhere?

The items are set up in wp_nav_menu(). There is a useful filter you can use: ‘wp_nav_menu_objects’. It offers the items as $sorted_menu_items and the arguments of the wp_nav_menu() call as $args. From wp-includes/nav-menu-template.php::wp_nav_menu(): $sorted_menu_items = apply_filters( ‘wp_nav_menu_objects’, $sorted_menu_items, $args ); So … hook into this filter, store the data somewhere, return the $sorted_menu_items unchanged and … Read more

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