我使用的代码来自here 将循环拆分为列。这些列可以工作。我在数据库中有7篇帖子,showposts设置为6篇。我无法获取要显示的下一页链接?我在$args数组中有一个$paged变量,我在admin/reading中将每页的帖子数设置为5。下面是完整的循环。非常感谢。
<?php
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$args = array(
\'showposts\' => 6,
\'&paged=\' => $paged,
\'tax_query\' => array(
array( \'taxonomy\' => \'post_format\',
\'field\' => \'slug\',
\'terms\' => array(\'post-format-audio\')
)
)
);
$the_query = new WP_Query($args);?>
<?php foreach(new WP_Query_Columns($the_query, 3) as $column_count) : ?>
<ul class="sc-track-list fourteen columns alpha">
<?php while ($column_count--) : $the_query->the_post(); ?>
<li class="sc-track">
<div class="sc-player">
<h1 class="entry-title"><a href="<?php echo get_post_meta($post->ID, \'_format_audio_embed\' , true); ?>"></a></h1><!--title-->
</div>
<div class="meta">
<span class="entry-date"><?php echo get_the_date(); ?></span>
<a class="spch-bub-inside" href="<?php comments_link(); ?>">
<span class="point"></span>
<em><?php comments_number(\'0\', \'1\', \'%\'); ?></em>
</a>
<span class="entry-tag"><?php the_tags(\' \'); ?></span>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="<?php the_permalink(); ?>"
data-via="jillowen"
data-text="<?php the_title(); ?>"
data-count="horizontal">Tweet</a>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php endforeach; ?>
<div class="navigation">
<div class="alignleft"><?php previous_posts_link(\'« Previous Entries\') ?></div>
<div class="alignright"><?php next_posts_link(\'« Older Entries\') ?>
</div>
</div>