Support » Plugin: Image Hotspot by DevVN » Ajouter le texte alternatif sur l’image principale

  • Resolved maxwell398

    (@maxwell398)


    Bonjour,

    Je souhaiterai que vous m’indiquiez comment ajouter une balise alt sur ma photo principale dans votre plugin?

    exemple :

    <div class="images_wrap">
    		<img class=" ls-is-cached lazyloaded" src="https://www.signaux-girod.fr/wp-content/uploads/2019/07/balise-nova-autorelevable-k5dhotspot.jpg" data-src="https://www.signaux-girod.fr/wp-content/uploads/2019/07/balise-nova-autorelevable-k5dhotspot.jpg">
    		</div>

    Je précise que le texte alternatif est bien rentré dans l’image sur wordpress.

    merci d’avance pour votre aide

    Maxime

    • This topic was modified 7 months, 2 weeks ago by maxwell398.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @maxwell398
    You can you just an markup like this :
    <img src="https://www.signaux-girod.fr/wp-content/uploads/2019/07/balise-nova-autorelevable-k5dhotspot.jpg" alt="Your ALT Text" />

    Thread Starter maxwell398

    (@maxwell398)

    Hello @erand

    Thank you for your reply but the objective is to get the completed “alt” field from the WordPress media library automatically by modifying the source code below:

    <div class="wrap_svl" id="body_drag_<?php echo $idPost;?>">
    		<div class="images_wrap">
    			<img src="<?php echo $maps_images; ?>">
    		</div>	

    I searched and found this :
    <?php echo get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ?>

    but I am not a developer and I don’t know how to adapt it to solve my problem.

    Any ideas?

    thank you in advance

    Thread Starter maxwell398

    (@maxwell398)

    Ok i have a solution,

    code :

    <div class="wrap_svl" id="body_drag_<?php echo $idPost;?>">
    		<div class="images_wrap">
    			<img alt="<?php the_title(); ?>" src="<?php echo $maps_images; ?>">
    		</div>	

    I get the title of the photo, it’s not the alt tag but it’s ok for me

    • This reply was modified 2 months, 1 week ago by maxwell398.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.