我在mysite有一个博客页面。com/blog。在这一页上,我有一个循环:
<?php
$args = array (
\'pagination\' => true,
\'paged\' => \'pages\',
\'posts_per_page\' => \'5\',
\'ignore_sticky_posts\' => true
);
?>
<?php $query = new WP_Query( $args ); ?>
<?php if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title(\'<h2 class="entry-title"><a href="\' . get_permalink() . \'" title="\' . the_title_attribute(\'echo=0\') . \'" rel="bookmark">\', \'</a></h2>\'); ?>
<p class="byline">
<span class="author vcard"><?php the_author_posts_link(); ?></span> <span class="sep">|</span>
<abbr class="published" title="<?php the_time(__(\'l, F jS, Y, g:i a\', \'example\')); ?>"><?php the_time(__(\'F j, Y\', \'example\')); ?></abbr>
<?php edit_post_link(__(\'Edit\', \'example\'), \' <span class="sep">|</span> <span class="edit">\', \'</span> \'); ?>
</p>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages(\'before=<p class="pages">\' . __(\'Pages:\',\'example\') . \'&after=</p>\'); ?>
</div>
<p class="entry-meta">
<span class="categories"><?php _e(\'Posted in\', \'example\'); ?> <?php the_category(\', \'); ?></span>
<?php the_tags(\'<span class="tags"> <span class="sep">|</span> \' . __(\'Tagged\', \'example\') . \' \', \', \', \'</span>\'); ?>
<span class="sep">|</span> <?php comments_popup_link(__(\'Leave a response\', \'example\'), __(\'1 Response\', \'example\'), __(\'% Responses\', \'example\'), \'comments-link\', __(\'Comments closed\', \'example\')); ?>
</p>
这就像预期的那样,但是我无法让分页工作。我尝试了多种选择。非常感谢您的帮助。