0

Good night.

Please help me.

Update WP to version 5.3 and you are now displaying this message on the WP website and admin (

Warning: Declaration of kiddy_Walker_Nav_Menu::walk($items, $depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /var/www/html/eeicurumim.com.br/web/wp-content/themes/kiddy/functions.php on line 3002

How can I solve this problem?

2

Lets say that you're a cook, and I tell you in order to pass a test you have to make:

  • 3 cakes
  • 1 pie
  • 7 cookies

And you come back to me with 4 cakes and a pie, those don't match, you failed the test.

The same thing is happening in your code:

Warning: Declaration of kiddy_Walker_Nav_Menu::walk($items, $depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /var/www/html/eeicurumim.com.br/web/wp-content/themes/kiddy/functions.php on line 3002

kiddy_Walker_Nav_Menu inherits from Walker but it has a mismatching incompatible function inside it.


So lets pick it apart, as it outright tells you what the problem is

kiddy_Walker_Nav_Menu::walk($items, $depth) should be compatible with Walker::walk($elements, $max_depth, ...$args)

Here's the problem, notice the parameters don't match, they must match. $items, $depth and $elements, $max_depth, ...$args are not the same.

in /var/www/html/eeicurumim.com.br/web/wp-content/themes/kiddy/functions.php on line 3002

Is just telling you which file the issue is in, and which line of the file it happens.

So how do you fix it?

You make them match. You need to accept 3 things, a set of items, a max depth, and some arguments. But your version doesn't do that, so start by adding , ...$args

  • Thanks Tom for the feedback, and sorry for entering my question in the wrong location. I don't know how to fix it yet, I identified the place end_el function (& $ output, $ item, $ depth = 0, $ args = array ()) { $ indent = ($ depth)? str_repeat ("\ t", $ depth): ''; $ logo_container = ''; if ($ item-> menu_item_parent == '0' and & $ this-> elements <$ this-> logo_in_menu_number && $ this-> elements == $ this-> elements_counter) { $ logo_container = $ this-> logo_ini ($ indent, $ item); } $ output. = "</li> \ n". $ logo_container; } But I still don't know what to adjust / change – Anderson Camargo Nov 13 '19 at 11:51
  • @AndersonCamargo I'm afraid you're going to need a minimum level of PHP understanding to fix this, the only alternative is to provide copy pasta which I won't do. You should go to the support for the theme you bought – Tom J Nowell Nov 13 '19 at 14:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.