• I have a content-centered blog where videos and content submitted by outside experts are displayed as posts. On each post, I’ve set the featured image to be a photo of the author.

    I’ve then created an “Authors” page using a basic WordPress loop, where all I’m calling in that loop is for the featured image for each post to display, along with the contributor’s name, which I’m using a custom field for. Here’s my code:

    <?php if (have_posts()) : ?>
    			<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    			<?php query_posts('posts_per_page=-1&orderby=title&order=ASC&cat=29&meta_key=WomanName&orderby=meta_value'); ?>
    			<?php while (have_posts()) : the_post(); ?>
    
    			<div class="women">
    				<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(100,100)); } ?>
    				<p><?php $customField = get_post_custom_values("WomanName"); if (isset($customField[0])) { echo "".$customField[0]; } ?><br />
    				<span class="info"><?php $customField = get_post_custom_values("Info"); if (isset($customField[0])) { echo "".$customField[0]; } ?></span></p>
    			</div>
    
    			<?php endwhile; ?>
    			<?php else : ?>
    			<?php endif; ?>

    The problem is if one contributor has written multiple posts (each one having the same featured image of that contributor), on the “Authors” page the contributor’s image shows up multiple times, depending on how posts they’ve written.

    My question is: how do I edit the loop so that if more than one post shares the same featured image, that image only displays once on the “Authors” page?

    Any help anyone can provide would be appreciated!

  • The topic ‘Not Duplicating Posts with Same Featured Image’ is closed to new replies.