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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.