• Hello,

    I have migrated a wordpress from one hosting to another, and I find an error in the new wordpress just migrated. I have found the file that presents problems, but I can not fix it. My knowledge about PHP is limited.

    Error (Displayed on the new wordpress):

    Warning: Declaration of description_walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /homepages/20/d762655672/htdocs/ar-t.es/wp-content/themes/kolos_en/admin/theme_functions.php on line 104
    
    File /themes/kolos_en/admin/theme_functions.php (Line 65 to 104)
    
    // Extend wp_nav_menu
    class description_walker extends Walker_Nav_Menu
    {
          function start_el(&$output, $item, $depth, $args)
          {
               global $wp_query;
               $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    
               $class_names = $value = '';
    
               $classes = empty( $item->classes ) ? array() : (array) $item->classes;
    
               $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
               $class_names = ' class="' . esc_attr( $class_names ) . '"';
    
               $output .= $indent . '<li' . $value . $class_names .'>';
    
               $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
               $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
               $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
               $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
    
               
               $description  = ! empty( $item->description ) ? '<span>'.esc_attr( $item->description ).'</span>' : '';
    
               if($depth != 0)
               {
                         $description = $append = $prepend = "";
               }
    
                $item_output = $args->before;
                $item_output .= '<a'. $attributes .'>';
                $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
                $item_output .= '</a>';
    			$item_output .= $description.$args->link_after;
                $item_output .= $args->after;
    
                $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
                }
    }
    

    —————————————————————–

    I have tried to modify this area of ​​the file, but the only thing I have achieved is to make the menu disappear (already reversed).

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter cahebe

    (@cahebe)

    New url is germanssalvador.es (old domain is ar-t.es ) … but in error, old domain is displayed again… “”””$item, $depth = 0, $args = Array, $id = 0) in /homepages/20/d762655672/htdocs/ar-t.es/wp-content/themes/kolos_en/admin/theme_functions.php on “”””

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You’re using a commercial theme, so please use their official support channel. We feel they are best equipped to support their products.

    https://themeforest.net/item/kolo-startup-landing-page-wordpress-theme/17796077/support

    Commercial products are not supported in these forums. .

    Thread Starter cahebe

    (@cahebe)

    Hi Stenven,

    This themeforest theme is not my theme….

    This template has many years, has been purchased or edited by staff that is no longer part of our web team and we do not have any support.

    Thanks

    Hi Cahebe,
    The point the previous reply was making is that the error is down to a broken theme, not a bug in WordPress. So you are unlikely to get help here, you’ll need to contact who ever supplied the original theme (ThemeForest or the actual theme developer).

    In saying that, if you are not seeing that error on the old server and only on this new server, one thing to check is the PHP versions on both server. Make sure the new server PHP version matches the old server.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Warning: Declaration of description’ is closed to new replies.