0, 'orderby' => 'title', 'order' => 'ASC', 'hide_empty' => false ); $product_categories = get_terms( 'product_cat', $args ); $count = count($product_categories); if ( $count > 0 ){ foreach ( $product_categories as $product_category ) { if(function_exists('get_term_meta')){ //show parent categories $thumbnail_id = get_term_meta($product_category->term_id, 'thumbnail_id', true); if (empty($thumbnail_id)) { // get the image URL for parent category $image = esc_html(get_template_directory_uri()).'/assets/images/default.png'; } else { $image = wp_get_attachment_url($thumbnail_id); } } echo '
'; echo'
'; echo '
'; } }?>