1. Documentation /
  2. Display product attribute archive links

Display product attribute archive links

This is a Developer level doc. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy.

You will need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

Display product attribute archive links

↑ Back to top

Display WooCommerce product attribute archive links on the product page, right below the add to cart button.

Also remember to add the pa_ prefix to the attribute. An example would be: pa_color — or it wouldn’t work.

If you’d like to display this on the archive page, replace the add_action( 'woocommerce_product_meta_end', 'wc_show_attribute_links' ); with the following hook:

add_action( 'woocommerce_shop_loop_item_title', 'wc_show_attribute_links' );

  • 30-day money-back guarantee
  • Support teams across the world
  • Safe and secure online payment