Get the Product tags for the current product only in WooCommerce
问题 How can I display only the product tags for the current single product page and not all the products tags? I've found questions about most popular tags but not for that. 回答1: You can use the function wp_get_post_terms() function for WooCommerce 'product_tag' custom taxonomy and a defined product id this way: $output = array(); // get an array of the WP_Term objects for a defined product ID $terms = wp_get_post_terms( get_the_id(), 'product_tag' ); // Loop through each product tag for the