• Hello,

    I’m trying to have a gallery with thumbnails that link to the full size image in a post, so that when clicked the gallery thumbnail will open a lightbox with the full image. So far, I’ve tried using wp_get_attachment_link() and the_attachment_link(), which I thought should have done the trick. But it only resulted in a “missing attachment” message.

    Here is the loop I have so far:

    <ul id="portfolio-list">
    			<?php query_posts('cat=5&showposts='); ?>
    			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    				<li class="<?php $category = get_the_category(); echo $category[0]->cat_name; ?> all">
    					<a href="<?php the_attachment_link();  ?>">
    						<?php the_post_thumbnail(); ?>
    						<h3><?php the_title(); ?>.</h3>
    						<p><strong>tags:</strong> <?php $category = get_the_category(); echo $category[0]->cat_name; ?></p>
    					</a>
    				</li>
    			<?php endwhile; ?>
    			<?php endif; ?>
    		</ul><!-- /#portfolio-list -->

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • have you tried the plugin nextGEN Gallery

    Thread Starter polymaze

    (@polymaze)

    Yes, I’ve tried it, and it doesn’t work the way I was hoping. Is there a way to link directly to the fullsize image in a post loop?

    Thank you for your suggestion. I’m actually looking through the plugin to see if there is code I can use.

    Thread Starter polymaze

    (@polymaze)

    Alright, so after spending a few hours digging through the code, and not understanding a lot of it, I’m at almost the same point that I started.

    Does anyone even know if there is a way to link a thumbnail to a post attachment image within the loop? I’m finding it hard to believe that I would be the first to think this up.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gallery Link From Thumbnail To Fullsize Image’ is closed to new replies.