Home Forums Front-end Issues wp_nav_menu_objects doesn't work


wp_nav_menu_objects doesn't work

  • Hello,

    Since yesterday, I displayed icons on my navigation bar with this :

    add_filter('wp_nav_menu_objects', 'my_wp_nav_menu_objects', 10, 2);
    function my_wp_nav_menu_objects( $items, $args ) {
    	foreach( $items as &$item ) {
    		$image = get_field('image', $item);
            $size = 'medium';
    		if( $image ) {
    			$item->title = wp_get_attachment_image( $image, $size, '', ["class" => "mb-2"] ) . $item->title;
    	return $items;

    Today, Images doesn’t display on the navigation bar. I can display what I want in “if( $image ) {}” (like text or images ID), but wp_get_attachment_image doesn’t work…

  • I displayed icons on my scrollbars set to always show in OS X, as described in that GiHub issue. able to not solve the problem

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.