0
這是我的檔案頁面代碼如何在歸檔頁面創建多個循環?
我希望避免在第四個環&重複的帖子,我想在第3圈數後
有4個迴路
1第一循環次數:1後
<?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秒環 - - 計數= 1交
<?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第三loop--計數= 5交
<?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環 - 計數=所有的其餘部分後
<?php else : ?>
<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a>
- 廣告計數 -
<?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; ?>
請問您可以修改代碼嗎?我很困惑 – atali
在這裏附加文件,我會爲你修改。 –
這裏是文件http://pastebin.com/Cbg95nDY。非常感謝您的幫助 您可以看到存檔頁面中存在重複的帖子 – atali