如何在wordpress中添加自定义分页 [英] How to add Custom pagination in wordpress
问题描述
我在 wordpress 中创建了自定义主题.我想将自定义分页添加到我的自定义帖子模板 INDEX.PHP
你能检查一下分页脚本有什么问题吗?实际上我已经设置了 4 个帖子限制,我的博客中大约有 8 个帖子......当点击 2 分页时,它不会移动到下一页......
<?php get_header();?><?php$paged = ( get_query_var( 'paged' ) ) ?absint(get_query_var('paged')):1;//WP_Query 参数$args = 数组 ('post_type' =>the_post(),'posts_per_page' =>'3','分页' =>$分页);?><?php//查询$cquery = new WP_Query( $args );while ( $cquery->have_posts() ) : $cquery->the_post();?><div class="row"><div class="img"><a href="<?php the_permalink() ?>"class="imgPos"><?php the_post_thumbnail('full');?></a></div><div class="text"><h2><a href="<?php the_permalink() ?>"style="color:#545454;"><?php the_title();?></a></h2><h3 style="line-height: 1px;"><span class="floatL">作者 </span><span class="floatL"><?php the_author_posts_link();?> </span><span class="floatL"> - </span><span class="floatL"><?php the_time('F jS, Y');?></span><div class="clr"></div></h3><p><?php the_content('阅读更多') ?></p>
<?php$post->ID;终了;$big = 999999999;//需要一个不太可能的整数?><div class="row"><div class="分页"><?php回声分页链接(数组('基础' =>str_replace( $big, '', esc_url( get_pagenum_link( $big ) ) ),'格式' =>'?paged=%#%','当前' =>max( 1, get_query_var('paged') ),'总计' =>$cquery->max_num_pages) );?>
<?php get_footer();?>