why get_the_post_thumbnail( the_ID()) echos extra post id

by fefe   Last Updated June 17, 2019 14:08 PM

I have the following snippet which adds post thumbnails to products on archive page if matches a given product category, which will output the image but echos the the post id as well. How do I suppress to not show post id?

add_action( 'woocommerce_after_shop_loop_item_title', function () {
    if(is_product_category('t-shirts')) {
        $thumb = get_the_post_thumbnail( the_ID());
        if(is_string($thumb) ) {
            echo '<div class="imagewrapper">' . $thumb;
        }
    }

}, 9 );
add_action( 'woocommerce_after_shop_loop_item_title', function () {
    if(is_product_category('t-shirts')) {
        $thumb = get_the_post_thumbnail( the_ID());
        if(is_string($thumb) ) {
            echo '</div>';
        }
    }
}, 11 );


Related Questions


Display child categories in WooCommerce

Updated March 11, 2019 12:08 PM

Show product_cat featured image in naviagtion (sub)menu

Updated November 25, 2016 08:03 AM

"Sticky" posts for each category (archive.php)

Updated June 04, 2015 13:03 PM

How to Remove Category Archives title

Updated December 16, 2016 08:03 AM