Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a thumbnail of the featured image, which is linked to a larger version of the file. At the moment the file just opens in a standard browser window, but I would like it to open in an attachment page, but I can't figure out how to do it! Here is what I have at the moment:

<?php if ( has_post_thumbnail()) : ?>
<div class="spudpictureandcontentwrapper">
<div class="illustration">
<?php  $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
the_post_thumbnail('thumbnail'); ?>
</a></div> 

<?php endif; ?>

I'm guessing I need to use a different function to pass a value to $large_image_url but can't work out which one.

share|improve this question
    
well i guess you want to load that image in another tab it seems, if thats the case you can use target="_blank" attribute of anchor tag <a target="_blank" href="..... </a> –  pr1nc3 Aug 23 '13 at 12:24
    
No, I'd want it in the same browser window so that the 'back' button is still available, the users will be quite old and I don't want to confuse them by taking them to a new window –  Mactonex Aug 23 '13 at 12:26
    
At the moment the file just opens in a standard browser window, but I would like it to open in an attachment page<-- i dint get it. could you show me the link ? –  pr1nc3 Aug 23 '13 at 12:28
    
    
yes i see upon clicking image gets loaded in the same window.what you mean by "attachment page" ? do you want to open this image in thick box ? google thick box if you dont know about it . –  pr1nc3 Aug 23 '13 at 12:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.