This is how I am currently trying:

$taxonomies = array( 
   'product_cat'
);
$args = array(
   'orderby'           => 'name', 
   'order'             => 'ASC',
   'hide_empty'        => false, 
   'exclude'           => array(), 
   'exclude_tree'      => array(), 
   'include'           => array(),
   'number'            => '', 
   'fields'            => 'all', 
   'slug'              => '',
   'parent'            => '',
   'hierarchical'      => true, 
   'child_of'          => 0,
   'childless'         => false,
   'get'               => '', 
   'name__like'        => '',
   'description__like' => '',
   'pad_counts'        => false, 
   'offset'            => '', 
   'search'            => '', 
   'cache_domain'      => 'core'
); 

$terms = get_terms($taxonomies, $args);
$print_terms = 0;
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
   foreach ( $terms as $term ) {
     $term_img = wp_get_attachment_url( get_post_thumbnail_id($term->term_id) );
     var_dump($term_img); /* Allways Bool(false) */

So question is,

Do you know what am I doing wrong?

5 s
5

The images where setted by woocommerce,

In case someone needs, this is how I did it

$thumb_id = get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true );
$term_img = wp_get_attachment_url(  $thumb_id );

Leave a Reply

Your email address will not be published. Required fields are marked *