Php 使用快捷码显示非特色的最新产品?

Php 使用快捷码显示非特色的最新产品?,php,wordpress,woocommerce,shortcode,featured,Php,Wordpress,Woocommerce,Shortcode,Featured,在WooCommerce中,我试图获得没有此短代码的“最新产品”: [product_attribute attribute='_featured' filter='no' orderby="date" order="desc"] 但似乎没有任何效果。 我怎样才能做到这一点 请不要推荐第三方插件* 谢谢 *官方的更多信息在这个快捷码中,属性适用于可变产品,而您的实际快捷码不能真正工作,因为特色产品功能不是一个属性 您最好尝试使用短代码,在所有特色产品中设置一个“特色”类别(带有“特色”slug

在WooCommerce中,我试图获得没有此短代码的“最新产品”:

[product_attribute attribute='_featured' filter='no' orderby="date" order="desc"]
但似乎没有任何效果。

我怎样才能做到这一点

请不要推荐第三方插件*

谢谢


*官方的更多信息

在这个快捷码中,属性适用于可变产品,而您的实际快捷码不能真正工作,因为特色产品功能不是一个属性

您最好尝试使用短代码,在所有特色产品中设置一个“特色”类别(带有“特色”slug)

然后您可以这样使用快捷码:

[最新产品类别class='featured'运营商class='NOT IN']
您不需要设置
orderby
order
参数,因为默认参数是:

$atts = shortcode_atts( array(
    'per_page' => '12',
    'columns'  => '4',
    'orderby'  => 'date',
    'order'    => 'desc',
    'category' => '',  // Slugs
    'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
), $atts, 'recent_products' );

请参阅相关文档:

在此短代码中,属性可用于可变产品,而您的实际短代码实际上无法工作,因为特色产品功能不是属性

您最好尝试使用短代码,在所有特色产品中设置一个“特色”类别(带有“特色”slug)

然后您可以这样使用快捷码:

[最新产品类别class='featured'运营商class='NOT IN']
您不需要设置
orderby
order
参数,因为默认参数是:

$atts = shortcode_atts( array(
    'per_page' => '12',
    'columns'  => '4',
    'orderby'  => 'date',
    'order'    => 'desc',
    'category' => '',  // Slugs
    'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
), $atts, 'recent_products' );
见相关文件: