我有下面的代码,但分页不起作用:
<?php
/*
Template Name: Service Page
*/
get_header();?>
<!-- service Section -->
<section id="practice-wrap1" class="section-gray">
<div class="container-fluid">
<div class="row text-center">
<?php
$query = new WP_Query(array('post_type'=>'service-items', 'posts_per_page' => 4, 'page'=> $paged, 'order' => 'DESC'));
?>
<?php if ($query->have_posts() ) : while ($query->have_posts() ) : $query->the_post(); ?>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="service-item">
<div class="service-item-img">
<?php the_post_thumbnail('service-items', array('class' => 'post-thumb')); ?>
<div class="overlay-one transition4s"></div>
</div>
<div class="service-content">
<div class="service-icon">
<span><i class="fa fa-globe"></i></span>
</div>
<h3 class="title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
<p class="description"><?php echo word_count(get_the_excerpt(), '20'); ?> </p>
<a href="<?php the_permalink();?>" class="read-more fa fa-plus"></a>
</div>
</div>
</div>
<?php endwhile; ?>
<?php echo paginate_links();?>
<?php else:?>
<p><?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</div>
</div>
</section>
<?php get_footer();?>
我正在尝试使用paginate_links Wordpress功能但无论我把它放在哪里,我都无法使其工作。有人可以帮我这个吗?
答案 0 :(得分:0)
请查看以下链接,希望这能让你清楚:
[
{
"userType":5,
"label":"c7e5cb45ba764ad7ad29b5bdd4f12128",
"value":"John",
"acl":[
{"value":"view", "label":"View"}
]
},
{
"userType":5,
"label":"f673beac0245462f8c71066536049e72",
"value":"Allan",
"acl":[
{"value":"view", "label":"View"},
{"value":"modify", "label":"Modify"},
{"value":"remove", "label":"Remove"}
]
}
]