Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to create a custom products slider for my woocommerce theme. I want to retrieve the thumbnails from my products with a custom taxonomy (product_tag) for example "t-shirt".

I'm calling the "product_tag" like this :

<?php
 $categories = get_terms( 'product_tag', 'orderby=count&hide_empty=0' );

 $count = count($categories);
 if ( $count > 0 ){
     echo "<ul>";
     foreach ( $categories as $categories ) {
       echo "<li>" . $categories->name . $categories->count . "</li>";

     }
     echo "</ul>";
 }
     ?> 

But how can I get the URL thumbnails from this product_tag?

Something like wp_get_attachment_url( $id ) but for products?

share|improve this question
Where are the images stored? In which field? – toscho Nov 22 '12 at 0:37
The images are stored in the database and in the media pool, but I upload the images with woocommerce products in wordpress. – Rodrigo Sanz Nov 22 '12 at 9:52
Taxonomy terms have no custom fields, so how are the images set in relation to the product_tag terms? – toscho Nov 22 '12 at 10:12
I don't know if I'm explaining it wrong, but 'product_tag' it's argument that retrieves all products_tags from woocommerce products, the code showing up there, gives me an array with all this parameters : [term_id][name] [slug] [term_group] [term_taxonomy_id] [taxonomy] [description] [parent] [count] for all the tag names I created for the products in woocommerce. I don't know if there's a relationship, with the images, but i know that i can obtain the name of my product_tag, with the number of the products that are inside, so i thought that could be the start point to make a custom slider. – Rodrigo Sanz Nov 22 '12 at 14:21
Do you have another way or suggestion to do a custom slider with woocommerce? Thanks – Rodrigo Sanz Nov 22 '12 at 14:22

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.