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); }
============================================================================= [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!
This reply is for PremiumPress customers only.
534
Views
2
Replies
Copyright © 2010-2025 PremiumPress Limited.
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:
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!
Members Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login Now