【发布时间】:2016-03-09 17:23:01
【问题描述】:
我在wp-pagenavi 插件上遇到了非常奇怪的问题。我正在使用 WooCommerce 插件,它运行良好。现在我制作了一个页面模板并想显示所有产品类型为捆绑的产品,我的产品显示但 wp-pagenavi 不起作用。我还尝试在博客页面上完美运行,但在我的页面模板中却没有。
这是我的代码:
页面模板名称
<?php
/*
Template Name: Bundle Products
*/
get_header();
?>
我的客户查询
<?php
$paged = get_query_var('page') ? get_query_var('page') : 1;
$gb_bundle_args = array(
'post_type' => 'product',
'order' => 'DESC',
'paged' => $paged,
'tax_query' => array(
array(
'taxonomy' => 'product_type',
'field' => 'name',
'terms' => 'bundle'
)
)
);
$gb_bundle_qry = new WP_Query($gb_bundle_args);
if($gb_bundle_qry->have_posts()) :
while($gb_bundle_qry->have_posts()) :
$gb_bundle_qry->the_post();
the_title();
echo '<br />';
endwhile;
else :
echo "No Bundle Products";
endif;
wp_pagenavi();
wp_reset_query();
?>
我搜索了很多关于这个但没有找到。
【问题讨论】:
标签: wordpress pagination woocommerce