Viewing 30 posts - 1 through 30 (of 44 total)
  • Author
    Posts
  • #640860

    How can the image title and alt tag be set when using the image media element?
    By using this you can only set the title and alt tag of the ‘main’ image in the image library. So when setting it here it will change the tag of the image itself, not of the instance imported in the sepcific page.

    For seo purposes we need to give the image used on every specific page a specific alt tag.

    How to solve this?

    #641219

    Hi hotspot,

    I’m not sure I understand what you mean by that, could you link to a page where you are unable to set the meta tags so we can have a look at it please?

    Regards,
    Rikard

    #641381

    Hi Rikard,
    Below the urls to two pages where we setup some images to show the problem.
    On both pages we inserted an image with ALB and an image without ALB.

    Hope there is a way to solve this (or in the next update).

    Love to hear from you.

    #642362

    Hi,

    Unfortunately, you can’t set a unique alt attribute for images added via Image Element. Use the text block or code block instead.

    <img src="URL HERE" alt="ALT HERE" />
    

    If you want to use the actual html of the Image Element:

    
    <div class="avia-image-container avia-align-center " itemscope="itemscope" itemtype="https://schema.org/ImageObject">
    <div class="avia-image-container-inner"><img class="avia_image " src="http://www.123vochtbestrijding.nl/wp-content/uploads/slide3__0000sboy.png" alt="man test - alt set in media library" title="man test - title set in media library" itemprop="contentURL"></div>
    </div>
    

    Best regards,
    Ismael

    #642439

    Hi Ismael,

    Thanks for looking into it.

    I find it really strange that there is no support for it. From SEO purposes this is an very important SEO setting.
    Any idea how to make this an urgent future request?
    It would be very efficient to be able to add the alt tag with ALB image item.

    Regards

    #642849

    Hi!

    The option is already available in the media library and you can add an image manually so we don’t think this is an option that everybody will actually use. Please request the feature here: https://kriesi.at/support/enfold-feature-requests/

    Best regards,
    Ismael

    #642918

    The media library sets the alt tag for the image. But if the same image is used on a different page, you cannot set a different alt tag.

    #643003

    Hey!

    You can edit the image from the text view and add a different alt tag to it, as Ismael suggested.
    On the other hand, you can also target each image with some JS and do a different alt to it…

    I do not think that this is such a Enfold Issue, further more a Media Managment of WordPress, so better to open a trac issue there

    Best regards,
    Basilis

    #643006

    Hi Basilis,

    Thank for your reply.
    In WP it is possible to set a different alt tag to an image when it is inserted in a page.

    It would be great if we can add the alt tag to the shortcode (in text view), is it possible to add an alt tag to the shortcode like below:

    [av_image src='https://www.site.com/wp-content/uploads/image.png' attachment='1110' attachment_size='full' align='center' styling='' hover='' link='' target='' caption='' font_size='' appearance='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' animation='no-animation' custom_class=''][/av_image]

    #643615

    Hi,

    I think this would be a good idea. Please feel free to make a feature request about this here: kriesi.at/support/enfold-feature-requests/

    Best regards,
    Andy

    #643648

    Hi Andy,

    I made a request already.

    But, is it possible to add the alt tag in the shortcode now?

    #644475

    Hi,

    I’m sorry but it’s not possible yet. Use the code block or text block then add the image tag manually if you really need to add a unique alt tag for the same image.

    Best regards,
    Ismael

    #693566

    Any updates on this matter? Since you collaborate with WPML we hope this matter will be incorporated in the theme soon. For SEO this is really a must.

    #694845

    Hi,

    I’m sorry but this is feature is not included in the theme yet. For now, you can try the text block, add the image tag manually.

    Best regards,
    Ismael

    #874601

    Any news yet on this “flaw”?
    For seo purposes of our website that is in different languages it is a must to change the alt tags of the images for each image.
    You theme states that it is wpml compatible, but it is not for this feature…

    Any news?

    #875915

    Hi,

    Sorry. This feature is still not included in the Image element. You can still use the code or the text block element which is technically the same.

    Best regards,
    Ismael

    #1134165

    Hi Ismael, the alt have not yet been included in the default enfold theme?

    #1134996

    Hi,

    The alt and title attribute is already added in the Image element. This is an example of the image element markup.

    
    <div class="avia-image-container  av-styling-    avia-builder-el-0  el_before_av_fullscreen  avia-builder-el-no-sibling  avia-align-center " itemtype="https://schema.org/ImageObject" itemscope="itemscope" itemprop="image">
    <div class="avia-image-container-inner">
    <div class="avia-image-overlay-wrap"><img width="300" height="188" title="Image Title" class="avia_image" alt="An alternate text" src="http://site.com/image.jpg" itemprop="thumbnailUrl"></div>
    </div>
    </div>
    

    Best regards,
    Ismael

    #1135035

    That’s right, but it doesn’t appear in my page code, especially in masonry images

    • This reply was modified 5 years, 3 months ago by John Roa.
    #1135907

    Hi,

    Where can we see the issue? Please open a new thread and provide the link to the page with the images. We’ll close this thread now.

    Best regards,
    Ismael

    #1154656

    Any news on this?

    #1154690

    https://kriesi.at/support/topic/set-image-alt-tag-and-title-in-image-media-element/#post-642918

    And for multilanguage sites it could be nice to set different langage specific alt and title attributes.
    Allthough f.e. with WPML this is possible in media library too – the easier way is to set it manually.

    Based on image.php of last Enfold Version 4.6.3.1
    I needed this by myself – so i can share this here.
    This Custom Alt input field overwrites the Alt attribute from the Media Library only in this case. If the field remains empty, you have the Media Library Alt attribute – if that doesn’t exist – you have an empty Alt attribute.
    Maybe you should even add something like : Image Alt or something similar for SEO reasons.
    ;)
    https://pastebin.com/dl/ehe0nEuK ( no support on that – those who do not know how to use edited ALB in Child-Themes should read in the documentation )

    #1154993

    i added custom title attribute aswell.
    see here: https://pastebin.com/ehe0nEuK
    Download here: https://pastebin.com/dl/ehe0nEuK

    #1155310

    Besides the working edited image.php – : hm for masonry gallery and gallery ? – i do not see where Enfold sets this Input Field for Caption. Maybe it is possible to add here a custom Title / Alt Inputfield

    #1156029

    Guenni007 that is fantastic. Kriesi should implement it!

    #1156042

    You are welcome. It would be nice to have this for the galleries too! but my abilities and times are limited.

    by the way – there are comments in the php to see what is new or changed – so you can see how it is done

    #1156369

    Hi,

    Thanks @Guenni007.

    You should be able to add more fields in the filter used to add the copyright field in the gallery items. It’s in the functions-enfold.php file.

    if( ! function_exists( 'av_attachment_copyright_field_edit' ) )
    {
        function av_attachment_copyright_field_edit($form_fields, $post)
        {
    
            $form_fields['av_copyright_field'] = array(
                'label' => __('Copyright'),
                'input' => 'text',
                'value' => get_post_meta( $post->ID, '_avia_attachment_copyright', true ),
    		);
    
            return $form_fields;
        }
        add_filter( 'attachment_fields_to_edit', 'av_attachment_copyright_field_edit', null, 2 );
    

    Add a new value in the $form_fields array. Example:

    		$form_fields['av_custom_field'] = array(
                'label' => __('Custom Field'),
                'input' => 'text',
                'value' => get_post_meta( $post->ID, '_avia_attachment_custom_field', true ),
            );
    

    You will then be able to get the value of the field using the get_post_meta function.

    $custom = get_post_meta($attachment_entry->ID, '_avia_attachment_custom_field', true );
    echo $custom;
    

    Best regards,
    Ismael

    #1156465

    Yes but this will add it permanently.? – so it will change everywhere the image is placed.
    but we want to be able to set alt- and title-attributes as needed without triggering an entry in the media library.
    As far as i know the copyright field goes to the attachements.

    As you can see in the image.php i created – the alt and title attributes are set but do not change the alt and title entries on attachment.

    #1156472

    It is time that they make the images of masonry and others have the default alt attribute, if it is an indispensable requirement according to google, then why not add it ?, thanks

    #1156605

    Hey!

    Yes but this will add it permanently.? – so it will change everywhere the image is placed.

    As suggested above, you have to edit the gallery template, fetch the value of the custom field from there, then assign it as the value of the gallery item’s title or alt attribute. Adding multiple custom fields should be possible — one for each required attribute. What do you mean exactly when you say “attachment”?

    Best regards,
    Ismael

Viewing 30 posts - 1 through 30 (of 44 total)
  • The topic ‘set image alt tag and title in image media element’ is closed to new replies.