{"id":4159,"date":"2020-02-23T11:43:43","date_gmt":"2020-02-23T10:43:43","guid":{"rendered":"https:\/\/demos.welaunch.io\/woocommerce-attribute-images\/?post_type=faq&#038;p=512"},"modified":"2024-01-22T14:16:00","modified_gmt":"2024-01-22T13:16:00","slug":"shortcode-to-show-attributes-image","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/shortcode-to-show-attributes-image\/","title":{"rendered":"Shortcode for show Attributes Image"},"content":{"rendered":"<p>If you use custom product templates to show attribute images in product short description for example, you can use our new shortcode. The shortcode is [woocommerce_attribute_images_attributes] with parameters for product (optional) and attributes (attribute name, separated by comma).<\/p>\n<p>Example to show attributes color and size for current product:<\/p>\n<pre>[woocommerce_attribute_images_attributes attributes=\"color\"]\n<\/pre>\n<p>Example to show attribute color for product with the ID 354:<\/p>\n<pre>[woocommerce_attribute_images_attributes product=\"PRODUCT_ID\" attributes=\"color\"]\n<\/pre>\n<p>Example showing only specific attribute values on non product pages:<\/p>\n<pre>\n[woocommerce_attribute_images_attributes attributes=\"pa_color\" values=\"black,grey\" ignore_product=\"yes\" hide_empty=\"yes\"]\n<\/pre>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-4159","faq","type-faq","status-publish","hentry","faq_topics-attribute-images-filter-hooks"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/4159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=4159"}],"version-history":[{"count":5,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/4159\/revisions"}],"predecessor-version":[{"id":17009,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/4159\/revisions\/17009"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=4159"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=4159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}