このコード(http://devotepress.com/faqs/display-popular-tags-wordpress)を見つけましたが、ショートコード([wpb_popular_tags])を使用しましたが、結果は表示されません。WooCommerceのサイドバーウィジェットで最も人気のある商品タグを表示
最も一般的なWooCommerce製品タグを表示するためにこのコードを使用するにはどうすればよいですか?ここで
は自分のコードです:あなたが知らないことを知っている必要が何をすべきか
function wpb_tag_cloud() {
$tags = get_tags();
$args = array(
'smallest' => 10,
'largest' => 22,
'unit' => 'px',
'number' => 10,
'format' => 'flat',
'separator' => " ",
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'echo' => false
);
$tag_string = wp_generate_tag_cloud($tags, $args);
return $tag_string;
}
// Add a shortcode so that we can use it in widgets, posts, and pages
add_shortcode('wpb_popular_tags', 'wpb_tag_cloud');
// Enable shortcode execution in text widget
add_filter ('widget_text', 'do_shortcode');
これを試してください:http://www.wpbeginner.com/plugins/how-to-display-most-popular-tags-in-wordpress/ –