Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在WooCommerce小部件侧栏中获取相关产品_Php_Wordpress_Woocommerce_Shortcode_Product - Fatal编程技术网

Php 在WooCommerce小部件侧栏中获取相关产品

Php 在WooCommerce小部件侧栏中获取相关产品,php,wordpress,woocommerce,shortcode,product,Php,Wordpress,Woocommerce,Shortcode,Product,有人知道如何将相关产品放在WooCommerce的侧边栏中吗 类似于此屏幕截图: 1)您可以使用此代码在文本小部件中启用短代码执行 // Enable shortcode execution in text widget add_filter ('widget_text', 'do_shortcode'); 代码位于活动子主题(或主题)的function.php文件或任何插件文件中 2) 然后在Wordpress窗口小部件中,您将能够添加并使用文本窗口小部件: [related_product

有人知道如何将相关产品放在WooCommerce的侧边栏中吗

类似于此屏幕截图:

1)您可以使用此代码在文本小部件中启用短代码执行

// Enable shortcode execution in text widget
add_filter ('widget_text', 'do_shortcode');
代码位于活动子主题(或主题)的function.php文件或任何插件文件中

2) 然后在Wordpress窗口小部件中,您将能够添加并使用文本窗口小部件:

[related_products per_page="4" columns="1"]

但是您必须为它制作一些定制CSS,以获得您想要的显示…或者构建您自己的定制小部件(或短代码)

1) 您可以使用此代码在文本小部件中启用短代码执行

// Enable shortcode execution in text widget
add_filter ('widget_text', 'do_shortcode');
代码位于活动子主题(或主题)的function.php文件或任何插件文件中

2) 然后在Wordpress窗口小部件中,您将能够添加并使用文本窗口小部件:

[related_products per_page="4" columns="1"]

但是您必须为它制作一些定制CSS,以获得您想要的显示…或者构建您自己的定制小部件(或短代码)


是的,目前它对我有效,我只是在定制css上工作。是的,目前它对我有效,我只是在定制css上工作。