1

My site is using WooThemes Statua theme. I'm trying to get my resized slider images to link to their respective full size images (or attachment pages).

I asked a similar question on the WooThemes support forums (members login required) and the code they provided links the images to the resized 960px Large image size instead of the Full size images.

Here's an example page on my site, using the single.php template, and its code.

How can I get the slider images to link to the full size originals or attachment pages?

2 Answers 2

3
$image = wp_get_attachment_image_src( get_post_thumbnail_id(  $post->ID ), "full" );

echo '<a href="' . $image[0] . '">Link to Full Size</a>';
7
  • For the large image to link to the full image, on what line should I add your $image href to the code: pastebin.com/U0q1RPTe
    – Ryan
    Aug 9, 2011 at 2:59
  • Around the IMG tag on lin3 43. It looks as though you've already done this.
    – Pippin
    Aug 9, 2011 at 17:01
  • I have the first line, starting with $image, on line 16 and the second line, starting with echo, on line 43. Unfortunately this still links to the resized Large image. Anyway to link this to the original, Full sized image?
    – Ryan
    Aug 11, 2011 at 0:26
  • Hmm, not sure, but you could just add a new image size like this: <pre>add_image_size('fullsize', 9999, 9999, false);</pre> then just link to the "fullsize" one.
    – Pippin
    Aug 11, 2011 at 14:21
  • I made some progress. I was able to add this link, and replace the current image links with it. However, this results in each link pointing to the same image. How can these link to their respective full size image?
    – Ryan
    Aug 12, 2011 at 20:54
0

You have got a $photo_size variable in your linked code. Change it according to sizes listed in the Codex (from large to full). Furthermore, you should point Woo at this, as they are using timthumb in the theme.

6
  • Changing line 8 of the code from "large" to "full" has no effect pastebin.com/U0q1RPTe
    – Ryan
    Aug 9, 2011 at 3:01
  • @Ryan Then change $width_setting and $height_setting.
    – kaiser
    Aug 9, 2011 at 11:39
  • I changed both of these variables and there's no difference - the slider images still link to the resized photos. Any way to link to the original, full size photos?
    – Ryan
    Aug 11, 2011 at 0:22
  • This: $src = wp_get_attachment_image_src($att_id, $photo_size, true); is where the size of the linked image comes from. If it's not that, then you linked/pasted the wrong code.
    – kaiser
    Aug 11, 2011 at 0:38
  • I spent some more time on this and discovered when I edit the param "large" to "full" and the width/height_settings it only affects the initial display image, not the linked image. I think the href="'. $src[0] .'" needs to be edited, I'm just not sure to what. It seems as if the display image and the linked image both use the same paramater - is there a way to separate them? I appreciate your help.
    – Ryan
    Aug 12, 2011 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.