I believe because:
the_ID() : Display the ID of the current item in the WordPress Loop.
and
get_the_ID() : Retrieve the ID of the current item in the WordPress
Loop.
So the_ID()
displays the post ID.
Try to use get_the_ID()
Related Posts:
- Display “add to cart” button on every listing in product category page?
- Display child categories in WooCommerce
- Category index featured image
- Get parrent category name
- Do not show sub categories in the loop on archive-product.php
- How to make product image inherit from category image
- Show the parent taxonomy by creating shortcode in woocommerce?
- How to get related category/categories in WordPress archive page
- Display All Products by Category with WooCommerce
- Can I set a default featured image for a category?
- How to get category and archive title?
- Get rid of WordPress category, tag and author archives?
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Category archive by year with permalink support /category/YYYY
- get_categories for custom post type with a specific custom taxonomy attached
- Woocommerce get category image full size
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- How can I add the featured image functionality to a custom taxonomy?
- 404 Error On Category and Tags Pages
- Force WordPress to Show Pages Instead of Category
- Decreasing the Memory Consumption of a WordPress Site?
- How can I make post fields required in WordPress?
- What’s the URL for a category archive?
- Sort posts by tags in category pages
- Programmatically create product category and add thumbnail in woocommerce
- How to get the category of the post and link it to the archive (of the category)
- How to hide a specific category posts in my monthly archive?
- Reflect nested categories in appearance > menus
- Optimal way to redirect home page to category archive?
- Create product category and keyword search form in woocommerce? [closed]
- Display posts links from a category group by year
- Display list of Sub-Categories and the posts they contain, within one main Category
- How to add a background image to category and display image on category page
- Sort category page with custom field
- How to create tabled index of posts in a certain category
- Remove child products from woocommerce category page [closed]
- How do I edit pre_get_post for the category the user is currently in?
- How would you create a “weekly” archive?
- Sticky Posts Not Sticking to Top of Category Archive
- Root level category, tag, author and archive pages to work
- Display WooCommerce product categories in a 4 columns custom menu [closed]
- Category Specific Archive
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- How to select product category while adding new product in woocommerce? [closed]
- Use get_term_children to get the sub category of a parent category for the current post
- Hide uncategorized products from the shop page
- Are Custom Taxonomy Templates Possible?
- “Sticky” posts for each category (archive.php)
- Remove word “Category” from WooCommerce product page [closed]
- I want exclude the particular category in sidebar
- Filtering search results
- WooCommerce change category url and product base
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Display only posts from referred category on date archive page
- Using widget logic I want to show only a widget on the archive page if there are no posts
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Output link to category from WP_Query loop of woocommerce products
- display woocommerce all category title on home page
- Creating archive pages for children categories
- Add Icons to the Product Category Sidebar Widget WooCommerce
- Add Product categories to WordPress menu without losing hierarchy
- How to get product count with respect to categories in WooComerce
- Custom page for WooCommerce’s /product-category/
- Getting categories id for all products in cart
- WordPress categories being called “archives” in google links. How to remove?
- Get woocommerce catogry
- get_cat_ID() not wokring
- Display the featured image from the last post
- conditional for sub category on archive page
- Sorting posts by season
- Different excerpt styles per category, but chronological
- WooCommerce duplicate sub categories and product slugs
- weekly archive for custom category
- WP_Query() returns null when results exist!
- How to make a Thumbnails Mosaic
- Set post categories to include parents when setting child category
- WooCommerce IF statements not working
- Linking products to categories
- Woocommerce category show subcategories only/omit posts for specific category
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Omit specific product categories from WooCommerce shortcode
- products nested by subcategories in a current category archive
- WordPress subcategories return 404 in custom template
- WC 3.x Get categories from variable product of the cart
- Display category name on featured image in wordpress excerpt
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Product Category WooCommerce
- How to remove category titles?
- Show archives by year from just one category
- Archives for each category on WP Multisite
- Archive.php filtered by pre-determined category
- How do I call posts with a certain tag?
- Hide woocommerce category name from specific pages
- Hide woocommerce category name from specific pages
- need to add custom field in more products
- Category being displayed without base parmalink
- How to change category and year archive permalinks/rewrite rules?
- How to redefine the sorting of product categories by menu_order?
- Pagination not visible on woocommerce’s category page
- How can I define a custom archive for childs of a specific category?