由于某些原因,我无法使用previous\\u posts\\u link和next\\u posts\\u link进行分页。
这是我的密码。。。
<?php $paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1; ?>
<?php // The Query
$the_query = new WP_Query(
array(
\'post_type\'=>\'article\',
\'posts_per_page\'=>2,
\'orderby\'=>\'date\',
\'paged\'=>$paged
)
);
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
if($the_query->current_post == 0 && $paged == 1) :
?>
<article class="latest">
<div class="summary">
<h4>LATEST ARTICLE:</h4>
<h2><?=the_title(); ?></h2>
<div class="entry-meta">
<?php proagent_posted_on(); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?=get_the_content_limit(300, \'More\'); ?>
</div><!-- .entry-content -->
<div class="entry-topics"><?=get_the_term_list($post->ID , \'topics\', \'Topics: \',\', \'); ?></div>
</div>
<?=the_post_thumbnail(\'feature-post-thumbnail\'); ?>
</article>
<?php else: ?>
<article class="previous">
<?=the_post_thumbnail(); ?>
<div class="summary">
<h2><?=the_title(); ?></h2>
<div class="entry-meta">
<?php proagent_posted_on(); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?=get_the_content_limit(300, \'More\'); ?>
</div><!-- .entry-content -->
<div class="entry-topics"><?=get_the_term_list($post->ID , \'topics\', \'Topics: \',\', \'); ?></div>
</div>
</article>
<?php endif; ?>
<?php endwhile; ?>
<nav id="nav-below" class="navigation">
<div class="alignleft"><?php previous_posts_link(\'« Newer Articles\') ?></div>
<div class="alignright"><?php next_posts_link(\'Older Articles »\') ?></div>
</nav><!-- #nav-below -->
还有。。刚刚注意到,当我转到/articles/page/2时,它可以工作,有一个指向/articles/like的链接,但从/articles/page没有指向第2页的链接。。为什么?
如果可以,请帮助。。。这快把我逼疯了。
谢谢做记号