Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter newstoob

    (@newstoob)

    Ok now I have it showing just 1 image on the attachment page, but it is the wrong pic. It’s pulling from another post not the correct post.

    Any ideas?

    Here’s the code on the attachment.php page:

    <?php if (have_posts()) : the_post(); ?>
    
    <?php $attachment_link = get_the_attachment_link($post->ID, true); // This also populates the iconsize for the next line ?>
    <?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
    
    				<?php echo $attachment_link; ?>
    
    	<?php else: ?>
    
    		<p>Sorry, no attachments matched your criteria.</p>
    
    <?php endif; ?>
Viewing 1 replies (of 1 total)