• cwelle

    (@cwelle)


    I was banging my head with this for weeks. I have great respect for this forum and everything around WP and I did my homework by searching for the answer both here and on other forums but I just can’t find the answer to the problem.

    I have logo design site with fairly large portfolio, more than 2000 logos. Every logo in portfolio is one post, in two categories – one is All Logos the second one is one of 20+ other categories. Every logo/post has its featured image used for thumbnail pages.

    The problem is some of these thumbnails (featured images) show up twice in the All Logos archive. This is kind of random. The archive pages are broken down to 20 thumbnails per page. They start repeating from early pages and seems that problem disappears after 10-15 pages. If I change the number of thumbnails per page different thumbnails start to duplicate.

    I am not sure if posting an URL is okay, given that it’s commercial site?

    Anyone got an idea what may be the problem?

    Here is the code:

    <?php get_header(); ?>
    
    <div id="page">
    
    	<div class="column span-10 first" id="maincontent">
    
    		<div class="content">
    
    		<?php if (have_posts()) : ?>
    
    		 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle"><?php single_cat_title(); ?></h2>
    
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
    
    	 <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
    
    		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
    
    	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    		<h2 class="pagetitle">Author Archive</h2>
    
      <?php /* If this is a tag */ } elseif (is_tag()) { ?>
    		<h2 class="pagetitle">Search Results for <?php single_tag_title(); ?></h2>
    
    		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    		<h2 class="pagetitle">Blog Archives</h2>
    
    		<?php } ?>
    
    <div class="opis">
    <?php echo category_description( $category_id ); ?>
    </div>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( '%s'), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
    
    		<?php endwhile; ?>
    
    	<br><br>	<?php wp_pagenavi(); ?>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    
    	<?php endif; ?>
    
    	</div> <!-- /content -->
    </div> <!-- /maincontent-->
    
    <?php get_sidebar(); ?>
    
    </div> <!-- /page -->
    
    <?php get_footer(); ?>
  • The topic ‘Random duplicate posts in archives problem’ is closed to new replies.