Home > AI > Uncategorized

Woocommerce – 函数

1)进入用户账户
<?php get_permalink(woocommerce_get_page_id("myaccount")); ?>

2)修改商品单页-相关产品(放在functions.php)
add_filter('woocommerce_output_related_products_args', 'st_related_products');
function st_related_products($args){
 $args = array(
 'posts_per_page' => 6,  //展示产品数量
 'columns' => 6,   //几列
 'orderby' => 'rand');  //排序
 return $args;
};

3)
woocommerce_content();

 

Related posts:

Leave a Reply