Image alt tags

Is there any way to make  Image shortcodes to read the ALT attribute from what is defined in the  media library instead of forcing to specify in each shortcode separately? 

Any help is appreciated.

thanks

Comments

  • Hi,

    unfortunately it is not possible. Alt tags for media must be setup from shortcode position.

    Thanks for understanding!
  • does it mean i need to manually add the alt image on the coding only?
  • Yes, the shortcode has a field for that
    [image src="" width="" height="" align="" border="0" margin_top="" margin_bottom="" link="" link_image="" target="" alt="" caption="" greyscale="0" animate=""]
  • hello, will it be possible in the future?
  • What exactly? It is possible. The alt="" attribute is avaliable.
  • edited October 2017
    I'm pretty sure you understand the question he is asking. And since BeTheme actually has code implemented to accomplish this, I believe you agree that this is something that should be working, it's just that your code is deprecated.

    Here's how to solve this problem:

    You need a child theme (actually I'm not sure if you need one, but it's best practice anyways) in order to overwrite the muffin functions. Then you can simply replace the old function "mfn_get_attachment_id_url" with a working one within your functions.php


    Since there is a restriction on how many characters I can post here, I can't post the entire solution, but I believe its straightforward enough.

    Edit:

    To account for relative image paths add this to the function:

    if (substr($url, 0, 1) === '/') {
    $url = get_site_url() . $url;
    }
  • Setting alt for images in visual Muffin-Builder works fine (there is a line to fill). It also works with shotcode.

    How do I set alt for the main Logo?
      
  • olexmacc
    Just go to your media library and add an alt text to this image.
Sign In or Register to comment.