Support

Account

Home Forums General Issues Menu Images ALT Tag Reply To: Menu Images ALT Tag

  • Sorry, I marked the answer as solved because I thought I had it for a sec, but I still cant get it to work

    Below is the code:

    	// loop
    	foreach( $items as &$item ) {
    		
    		// vars
    		$icon = get_field('menu_image', $item);
    		
    		// append icon
    		if( $icon ) {
    			
    			$item->title = ' <img src="' . $url['url'] . '" class="menu-image" alt="' . $image['alt'] . '"><br>' .$item->title;
    			
    		}
    		
    	}
    	
    	
    	// return
    	return $items;

    I have changed my field to output Image Array and am using the above code but it now wont display the image url or the alt tags….. Not sure what I am missing