an
groups-icon

Add alt to Store images

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Trannel Brika
    0 points
    Beginner

    Hi,

    I am trying to add alt tags to the store images for all of my coupons and I want them to reflect the name of the store they belong to.

    After some research I found that this file needs to be edited:

    wp-content/themes/CP/framework/class/class_shortcodes.php and more specifically this section:

    =============================================================================
    [IMAGE] – SHORTCODE
    ========================================================================== */
    function wlt_shortcode_image( $atts, $content = null ) {

    global $userdata, $CORE, $post;
    extract( shortcode_atts( array(‘text’ => “”, ‘link’ => 1, “gallery” => 0 ), $atts ) );

    $image = “”; $text = $text; $link = esc_attr($link); $gallery = esc_attr($gallery); $permalink = get_permalink($post->ID);
    if ( has_post_thumbnail() ) {

    if(isset($GLOBALS[‘flag-single’])){
    $image .= hook_image_display(get_the_post_thumbnail($post->ID, ‘full’, array(‘class’=> “img-polaroid”)));
    }else{
    $image = ‘‘;
    $image .= hook_image_display(get_the_post_thumbnail($post->ID, array(get_option(‘thumbnail_size_w’),get_option(‘thumbnail_size_h’)), array(‘class’=> “img-polaroid”)));
    $image .= $this->STICKER($post->ID);
    if(strlen($text) > 1){ $image .= “<span class=’ftext’>”.$text.”</span>”; }
    $image .= ‘
    ‘;
    }

    }else{
    // CHECK FOR FALLBACK IMAGE
    $fimage = hook_fallback_image_display($this->FALLBACK_IMAGE($post->ID));

    if($fimage !=””){
    if(isset($GLOBALS[‘flag-single’])){

    if(isset($GLOBALS[‘CORE_THEME’][‘listing’][‘fallback’]) && $GLOBALS[‘CORE_THEME’][‘listing’][‘fallback’] == ‘1’){
    $image .= $fimage;
    $image .= $this->STICKER($post->ID);
    if(strlen($text) > 1){ $image .= “<span class=’ftext’>”.$text.”</span>”; }
    }else{

    $image = “”;
    }
    }else{
    $image = ‘‘;
    $image .= $fimage;
    $image .= $this->STICKER($post->ID);
    if(strlen($text) > 1){ $image .= “<span class=’ftext’>”.$text.”</span>”; }
    $image .= ‘
    ‘;
    }
    }
    }
    // REMOVE FIXED WIDTH/HEIGHT VALUES
    $image = preg_replace( ‘/(width|height)=”\d*”\s/’, “”, $image );

    // REMOVE LINK
    if($link == 0){
    $image = “<span class=’frame’>”.preg_replace(“/<a[^>]*>(.*)<\/a>/iU”, “$1″, $image).”</span>”;
    }
    // ADD ON POP-UP GALLERY
    if($gallery){

    preg_match( ‘@src=”([^”]+)”@’ , $image , $match );

    $image = ““.preg_replace(“/<a[^>]*>(.*)<\/a>/iU”, “$1″, $image).”“;
    // NOW ADDON EXTRA GALLERY IMAGES AS HIDDEN VALUES
    $images = $user_attachments = $this->UPLOAD_GET($post->ID,0,array(‘type’ => ‘image’));
    if(is_array($images) && !empty($images)){
    foreach($images as $nimg){
    $image .= ““;
    }
    }

    $image .= ‘<script>jQuery(window).load(function(){jQuery(“a[rel^=\’prettyPhoto\’]”).prettyPhoto({animation_speed: “normal”, autoplay_slideshow: true, slideshow: 3000 });});</script>’;
    }

    // RETURN VALUE
    return hook_shortcode_image_output($image);
    }

    Can anyobody advice me on where in the code I add the alt tag to reflect the category name as the image alt tag?

    Many thanks!

    November 7, 2014 at 6:18 pm
  • Trannel Brika
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    November 11, 2014 at 12:47 pm
  • Trannel Brika
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    November 22, 2014 at 2:54 pm

534

Views

2

Replies