我正在尝试将分页链接插入到我的自定义post循环中。但是,每当我单击按钮转到下一页时,它都会转到一个url,如:http://example.com/services/property-portfolio/page/2
. 这就把我带到了帖子的第一个循环。我试过了http://example.com/services/property-portfolio/2
这起到了作用。如何解决此问题?
循环开始:
<?php
$paged = ( get_query_var(\'page\') ) ? get_query_var(\'page\') : 1;
$args = array(
\'post_type\' => \'properties\',
\'posts_per_page\' => 5,
\'paged\' => $paged
);
$carousel_num = 0;
$query = new WP_Query($args);
if ( $query->have_posts()) {
while ($query->have_posts() ) {
$query->the_post();
$id = get_the_ID();
$count = 0;
if(have_rows(\'images\')):
while(have_rows(\'images\')): the_row();
$count++;
endwhile;
endif;
?>