我需要分页方面的帮助。我试图将下一页和上一页显示该帖子的内容放在同一个类别中,但我不确定会发生什么,即什么都没有显示。
如果你能帮忙,非常感谢!
<div class="row">
<div class="page">
<?php
$previous_post = get_previous_post(\'%link\', \'Next post in category\', TRUE);
if ( $previous_post ) : ?>
<!-- [ PREVIOUS ITEM ]-->
<div class="col-xs-6">
<?php if ( has_post_thumbnail( $previous_post->ID ) ) : ?>
<?php echo get_the_post_thumbnail( $previous_post->ID, \'gallery-navigation\' ); ?>
<?php endif; ?>
<a href="<?php echo get_permalink( $previous_post->ID ); ?>"><div class="info">
<div class="info-gallery">
<h2 class="title"><?php echo $previous_post->post_title; ?></h2>
</div><!-- .info-content -->
</div></a><!---info -->
<span class="prevnext"><?php _e( \'Previous Featured\', ); ?></span></div>
<?php endif; //End of Previous Post Item ?>
<?php $next_post = get_next_post(\'%link\', \'Next post in category\', TRUE);
if ( $next_post ) : ?>
<!-- [ NEXT ITEM ]-->
<div class="col-xs-6">
<?php if ( has_post_thumbnail( $next_post->ID ) ) {
echo get_the_post_thumbnail( $next_post->ID, \'gallery-navigation\' ); }?>
<a href="<?php echo get_permalink( $next_post->ID ); ?>"><div class="info">
<div class="info-gallery">
<h2 class="title"><?php echo $next_post->post_title; ?></h2>
</div><!-- .info-content -->
</div></a><!-- -info -->
<span class="prevnext"><?php _e( \'Next Featured\'); ?></span></div>
<?php endif; //End of Next Post Item ?>
</div>
</div>