Okay
  Public Ticket #254566
Alt tag to images doesn´t work
Closed

Comments

  • Webmaster started the conversation

    Hello everyone!

    Cheking the SEO performance I realized that the alt tag of all the images (carrousel, animated or not) doesn´t work. I´ve just updated the salient latest version, checked all kind of stuff but still doesn´t work Please could you help me?. Many thanks!

  •  1,070
    ThemeNectar replied

    Hey Webmaster!

    You're correct - the Visual Composer image element isn't using that field when it should (an alt tag parameter should work on the image with animation shortcode though). This will be sorted in the next minor update - if you want the fix now, open your shortcode-processing.php file located in the nectar/tinymce directory and edit this section within the nectar_image_with_animation function:

    if(preg_match('/^\d+$/',$image_url)){
    	$image_src = wp_get_attachment_image_src($image_url, 'full');
    	$image_url = $image_src[0];	
    }
    

    to be this instead:

    if(preg_match('/^\d+$/',$image_url)){
    	$image_src = wp_get_attachment_image_src($image_url, 'full');
    	$wp_img_alt_tag = get_post_meta( $image_url, '_wp_attachment_image_alt', true );
    	if(!empty($wp_img_alt_tag)) $alt_tag = $wp_img_alt_tag;
    	$image_url = $image_src[0];
    		
    }
    

    Cheers :)

  • Webmaster replied

    Thank you very much for your help. As always... amazing support. Have a nice day and thanks!