【发布时间】:2020-11-17 14:35:51
【问题描述】:
我正在寻找 WP_Query() 的列参数。因为帖子类型将是product。请看下面的代码:
$args = array(
'post_type' => 'product',
'posts_per_page' => 8,
'columns' => 3, // Can we have something like this
);
$loop = new \WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
} else {
echo esc_html__( 'No products found', 'theme_core' );
}
wp_reset_postdata();
我们可以有一个列参数来获取每行的产品吗?
【问题讨论】:
-
你能澄清一下这个问题吗,在这里很难确定你在问什么
标签: php wordpress woocommerce