我已经添加了代码来分页帖子,但它似乎已被破坏,或者无法进行重置,或者仅仅取决于多站点安装。看一看。非常感谢:
<?php
/*template to display homepage contents inside tag main*/
global $post;
switch_to_blog( 1 );
?>
<div class="intro row"><?php
echo get_field(\'top_text\', $post->id);
$bottom=get_field(\'text_bottom\', $post->id);
?>
</div>
<div class="row">
<?php
$paged = (get_query_var("paged")) ? get_query_var("paged") : 1;
$request = new WP_Query(array(
\'posts_per_page\' => 2,
\'paged\' => $paged,
\'post_type\' => \'game\'
) );
if ( $request->have_posts() ) {
while ( $request->have_posts() ) : $request->the_post()?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 center-block single_game">
<div class="col-lg-12">
<div class="wrap">
<span class="col-lg-12"> <?php the_title();?></span>
<div class="single-mask">
<a class="btn btn-orange demo" href="<?php the_permalink();?>" >Играть</a>
</div>
<!--thumbnail image-->
<div><?php the_post_thumbnail(\'thumbnail\'); ?></div>
</div>
</div>
</div>
<?php endwhile;
?>
<div class="col-xs-12">
<?php $total_pages = $request->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, $paged);
echo paginate_links(array(
\'base\' => get_pagenum_link(1) . \'%_%\',
\'current\' => $current_page,
\'total\' => $total_pages,
\'prev_text\' => null,
\'next_text\' => null,
));
}
}
?>
</div>
<?php
do_action(\'addcannonical\'); ?>
</div>
<div class="row outro">
<?php
echo $bottom;
?>
</div>
<?php
现场示例如下:
slotsviewer.com,
http://онлайн-казино-украины.com.ua/