[woocommerce_product_filter_tag] shortcode shows a live Product Tag Filter, i.e. it displays product tags.
Used within appropriate context, the customer can click a tag (term) and the page will show the related products.
This shortcode must be used within appropriate context, i.e. where products are displayed, as for example on a shop page. As with all live product filters that this extension provides, this filter field is used to refine the selection of products and reduce it to a set that contains only those that match what the customer is looking for.
Use this filter shortcode on a shop page or together with the
[woocommerce_product_filter_products] shortcode on any page. The
[woocommerce_product_filter_products] shortcode displays the products as if you were on the shop page and in combination with the filter shortcode, it updates them dynamically when the customer clicks a tag.
You can use the shortcode attributes outlined below to customize the shortcode. For example:
- show_heading – Whether to display the heading for this filter. “yes” or “no”
- heading – You can provide a customized heading here or omit it to use the default. The heading will be displayed when there are terms to show, it will be hidden when there are none.
- heading_no_results – You can provide the text of an alternative heading to be displayed when there are no results.
- style – How to display the terms, “list” or “inline”.
- show_thumbnails – Whether to show thumbnails for the terms, “yes” or “no”.
- show_names – Whether to show the names of the terms, “yes” or “no”.
- show_count – Whether the number of related products per term will be shown, “yes” or “no”.
- hide_empty – Whether to automatically hide terms that have no related products.
- number – If a number is provided through this attribute, it limits the number of terms shown. If omitted, all applicable terms are shown.
- toggle – Hide the filter component when it has no options, “yes” (by default) or “no”.
- toggle_widget – Hide the widget when the component has no options, “yes” (by default) or “no”.
- orderby – Used to determine the order in which the tags are shown, “count” or “name” (default).
- order – Sets ascending or descending order, “asc” (default) or “desc”.
- depth – This allows to limit the depth within the term hierarchy by indicating a number. The default is 0, imposing no limit.
- filter – Whether live filtering should be enabled, “yes” or “no”.
- multiple – Whether to let visitors select more than one term, “yes” or “no”.
- number – How many tags to display, the default is 10 tags.
- show – This will determine whether all terms are shown (with “all”) or only those that are within the context of the selected term (with “set”).
- sizing – This controls whether the size of the entries is uniform or adjusted automatically, use “none” for uniform tag sizing or “auto”.
- thumbnail_sizing_factor – The number provided sets the relation between thumbnails and their terms. The default is “1.3”.
The advanced attributes should be left at their defaults unless there is the need to approach a specific case with this filter.
- heading_id – This sets the ID of the heading element.
- heading_class – This sets the class of the heading element.
- heading_element – Used to determine which HTML tag is used as the heading element.
- container_id – This sets the ID of the filter’s main div container element.
- container_class – This adds to the class of the filter’s main div container element.