Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]

The error message shows that the class description_walker extends the Walker_Nav_Menu class and overrides the start_el() method, but the signature differs from the method definition in the parent class.

As mentioned in comments, it would be best to contact the developer of your theme and ask for a corrected version of the theme.

If the developer cannot be reached or you really want to correct the theme yourself, you can do the following. But keep in mind that any changes to the theme files are overwritten on theme update.

Search the theme files for the function definition of start_el() inside the description_walker class. The line of code should look similar to this:

function start_el( $output, $item, $depth, $args ) {

Changing this line to the following should make the warning disappear:

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {

Leave a Comment