Close

Account

Documentation

Forum

Menu

How to add an Alt to a Image with JKreativ General Shortcode

  • 5176
    June 26, 2017 at 1:12 pm #23997

    Hi friends!

    I am fighting to add an alt to an image with your JKreativ General Shortcode.

    I have navigated for all your site but i hadn´t see any solution.

    [imgslider-wrapper]
    [imgslider imgurl=’http://www.urlimage.com/image1.jpg’ alt=’altImage1′]
    [imgslider imgurl=’http://www.urlimage.com/image2.jpg’ alt=’altImage2′]
    [/imgslider-wrapper]

    The “alt” tag not work. How can i pass an alt to each image?

    If you are going to tell me that you don´t have that option… I have to make your theme pass the AA yes or yes, so please give me the light how to make this real 😉

    I am now at /wp-content/themes/jkreativ-themes/lib/build-shortcode.php

    /** imgslider **/

    function jeg_imgslider ($atts, $content = null) {
    $atts = shortcode_atts(
    array(
    ‘imgurl’ => ”
    ),
    $atts
    );

    $imageurl = $atts[‘imgurl’];
    if(ctype_digit($imageurl) || is_int($imageurl)) {
    $imageurl = jeg_get_image_attachment($atts[‘imgurl’]);
    }

    return
    Imagen de.{$imageurl}.“;
    }

    My fake solution is to add an alt with url Image 😉

    Thanks!!!

    Post count: 5897
    Adek
    June 27, 2017 at 1:50 am #23998

    Hi There,

    You can try to to use this code below and replace the previous function.

    Let us know if you have further question. We will try to help as long as we can.

    Thank you

You must be logged in to reply to this topic.