Title: cath77's Replies | WordPress.org

---

# cath77

  [  ](https://wordpress.org/support/users/cath77/)

 *   [Profile](https://wordpress.org/support/users/cath77/)
 *   [Topics Started](https://wordpress.org/support/users/cath77/topics/)
 *   [Replies Created](https://wordpress.org/support/users/cath77/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/cath77/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/cath77/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/cath77/engagements/)
 *   [Favorites](https://wordpress.org/support/users/cath77/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Categories Images] Duplicate Categories](https://wordpress.org/support/topic/duplicate-categories-3/)
 *  Thread Starter [cath77](https://wordpress.org/support/users/cath77/)
 * (@cath77)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/duplicate-categories-3/#post-4733491)
 * Hi
 * I have put up my site the link to it is
    [http://www.ispysurf.com](http://www.ispysurf.com)
 * You will be able to see on the post thumbnails that all the category images are
   being assigned to every post regardless of what categories were actually selected.
 * This has something to do with the code in the loop. Any ideas how to fix it?
 * Thanks C
 *     ```
       <div class="content-container loop-container">
   
       	<?php if ( have_posts() ) : ?>
   
       		<div class="wrapper">
   
       			<?php /* Start the Loop */ ?>
       			<?php while ( have_posts() ) : the_post(); ?>
   
       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
       <a href="<?php the_permalink() ?>"><h2 class="entry-title"><span>
       <?php echo get_the_title() ? get_the_title() : __('Untitled', 'focus') ?>
   
       					</span></h2></a>
   
        <?php foreach (get_categories() as $cat) : ?>        
   
        <div class=cat_images>
   
        <img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
        <a href="<?php echo get_category_link($cat->term_id); ?>"></a>
   
        </div>
        <?php endforeach; ?>
        <div class="clear"></div>
   
         <a href="<?php the_permalink() ?>" class="thumbnail-wrapper">
       <!-- <div class="time"></div> -->
       <?php echo has_post_thumbnail() ? get_the_post_thumbnail() : focus_default_post_thumbnail();  ?>
   
       					</a>
       				</article>
   
       			<?php endwhile; ?>
   
       		</div>
   
       	<?php else : ?>
   
       <?php get_template_part( 'no-results', 'index' ); ?>
   
       	<?php endif; ?>
   
       	<div class="clear"></div>
   
       </div>
   
       <?php focus_content_nav( 'nav-below' ); ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Categories Images] Duplicate Categories](https://wordpress.org/support/topic/duplicate-categories-3/)
 *  Thread Starter [cath77](https://wordpress.org/support/users/cath77/)
 * (@cath77)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/duplicate-categories-3/#post-4733490)
 * Hi
 * I have put up my site the link to it is
    [http://www.ispysurf.com](http://www.ispysurf.com)
 * You will be able to see on the post thumbnails that all the category images are
   being assigned to every post regardless of what categories were actually selected.
 * This has something to do with the code in the loop. Any ideas how to fix it?
 * Thanks C
 *     ```
       <div class="content-container loop-container">
   
       	<?php if ( have_posts() ) : ?>
   
       		<div class="wrapper">
   
       			<?php /* Start the Loop */ ?>
       			<?php while ( have_posts() ) : the_post(); ?>
   
       				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
       					<a href="<?php the_permalink() ?>"><h2 class="entry-title"><span>
       						<?php echo get_the_title() ? get_the_title() : __('Untitled', 'focus') ?>
   
       					</span></h2></a>
   
                  <strong> <?php foreach (get_categories() as $cat) : ?>        
   
        <div class=cat_images>
   
        <img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" />
        <a href="<?php echo get_category_link($cat->term_id); ?>"></a>
   
        </div>
        <?php endforeach; ?></strong>
        <div class="clear"></div>
   
         <a href="<?php the_permalink() ?>" class="thumbnail-wrapper">
       						<!-- <div class="time"></div> -->
       						<?php echo has_post_thumbnail() ? get_the_post_thumbnail() : focus_default_post_thumbnail();  ?>
   
       					</a>
       				</article>
   
       			<?php endwhile; ?>
   
       		</div>
   
       	<?php else : ?>
   
       		<?php get_template_part( 'no-results', 'index' ); ?>
   
       	<?php endif; ?>
   
       	<div class="clear"></div>
   
       </div>
   
       <?php focus_content_nav( 'nav-below' ); ?>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)