This is my archive page codes
i want to avoid duplicate posts in 4th loop & i want to count post in 3rd loop
there are 4 loops
1 first loop count : 1 post
<?php
$count = 1;
if (have_posts()) : while (have_posts()) : the_post();
if($count == 1) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="" ><?php the_title(); ?></a>
2 second loop - - count = 1 post
<?php if (have_posts()) : ?>
<?php $count = 1; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>
<?php if ($count == 2) : ?>
<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?> </a>
3 third loop-- count = 5 post
<?php else : ?>
<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<h1>Most Viewed News</h1>
<?php endif; ?>
4 loop -- count = rest of all post
<?php else : ?>
<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a>
-- ad count --
<?php if ( $count == 3 || $count == 5 ) : ?>
<?php dt_show_ads();?>
<?php endif; ?>
<?php endif; ?>
<?php $count++; ?>
<?php endwhile; ?>
<?php else : ?>
<div class="post">
<h2 class="archiveTitle"><?php _e('Sorry','linepress');?></h2>
</div>
<?php endif; ?>