WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Forgive me if someone has asked this before, but i am trying to get some attributes displayed next to displayed content of product. I see the hook woocommerce_before_single_product_summary that displayed few attributes but not all. The woocommerce_before_single_product_summary let me back to directory structure in woo/templates/single-products/filename which is just

  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $post, $product;
if ($product->is_on_sale()) :

apply_filters('woocommerce_sale_flash', '<span class="onsale">'.__( 'Sale!', 'woocommerce' ).'</span>', $post, $product); ?>

Now i am lost, where do i go from here? How do i add my attributes to my product-catalog and single product page? Where do i go from the apply_filters? How do i find the generated html for the attributes?

share|improve this question
I don't see how the sale-flash.php template has anything to do with product attributes. I'm not sure your question is in scope, but try clarifying. – helgatheviking Nov 21 '13 at 23:42
up vote 2 down vote accepted

A look at the documentation or the source is always helpful. I guess, the correct file to refer to would have been product-attributes.php. For getting the product attributes this is available: get_attribute() ; to list them list_attributes() can be used, which makes use of the product-attributes.php template. You can use those and then hook into the fitting one to display the attributes. To learn more about hooks give the Plugin API a good thorough read.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.