Add link to product image
-
Hey guys,
For some reason the theme my client is using does not include the product thumbnails / image’s link to the image file. Meaning, I can’t use the lightbox to enlarge the image or any zoom magnifier plugins.
Maybe you could help me figuring out what do I need to edit?
This is the single-product.php code regarding the product images:
<div class="single_image"> <?php if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { echo the_post_thumbnail('page-single'); } else { inkthemes_get_image(600, 300); } ?></div>
The inkthemes_get_image function code is:
function inkthemes_get_image($width, $height) { $w = $width; $h = $height; global $post, $posts; //This is required to set to Null $img_source = ''; $permalink = get_permalink($id); ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); if (isset($matches [1] [0])) { $img_source = $matches [1] [0]; } $img_path = inkthemes_image_resize($img_source, $w, $h); if (!empty($img_path[url])) { print "<a href='$permalink'><img src='$img_path[url]' class='postimg' alt='Post Image'/></a>";
What do I need to do for it to work? :\
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add link to product image’ is closed to new replies.