The first parameter for get_the_post_thumbnail_url()
is the post ID or post object, and not the image size which is actually the second parameter.
So:
// Instead of this:
get_the_post_thumbnail_url( 'thumbnail' )
// You should use:
get_the_post_thumbnail_url( get_the_ID(), 'thumbnail' ) // pass a post ID
get_the_post_thumbnail_url( get_post(), 'thumbnail' ) // or post object
// Or you can pass a null to use the current post:
get_the_post_thumbnail_url( null, 'thumbnail' )
Related Posts:
- Featured image for product listings, but another image as the product image?
- WooCommerce Base Page Featured Image Custom Theme
- Product thumbnail size in catalog
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- how to get woocommerce product attribute slug
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- How do I add a text input field for customers to leave a note on a single WooCommerce product page?
- Where can I find a single item template
- Get Woocommerce Subscription Product
- WooCommerce pages accessible to logged in members only
- paypal not showing on woocommerce payments
- Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image
- Save and display selected product option and cost as cart item data in WooCommerce
- How to update the WooCommerce cart Icon to show new products added with JavaScript
- How to remove product base from WooCommerce product permalinks
- Remove the link from the thumbnail and product title on woocommerce
- How to configure Woocommerce Payment Methods programmatically?
- woocommerce_package_rates not fired everytime
- how to change woocommerce shop archive description? [closed]
- How to display the result of a custom metabox in the frontend [closed]
- Quantity on the product card and subtotal disappear [closed]
- Admin access for custom user capabilities
- Display product category taxonomy terms in WooCommerce shop loop
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Subscription on Checkout
- Woocommerce – display product in page but in list format with excerpt
- how to show store name when I add a product on cart in woocommerce(woocommerce multi store)?
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Woocommerce Moving Review Below add to cart breaks button
- Create archive page for woocommerce attribute
- Refund from wooCommerce with stripe [closed]
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- Setting an attribute as variation in woo commerce via php [duplicate]
- WooCommerce – Conditionally enable shipping for virtual products
- display product’s category static slider name and image in loop wordpress
- Whitespace between product image and gallery on initial load of lightbox product page
- Why is my WordPress login credentials missing, but work with WooCommerce?
- Update Customer JWT Woocommerce
- Is there a hook in woocommerce for when a payment fails to display a custom error message?
- How to show notice alert only on product dashboard page?
- Retrieving Tag Name in Template Part from Filtered URL
- ajax request in wordpress
- Woocommerce Canceled Order Notification email to admin
- separate functions for home VS other pages
- WooCommerce apply shipping rates based on price
- Extra items added to cart on refresh, woocommerce
- How disable some product features on woocomerce?
- Hide sidebar and change layout Blog Page using is_page() function
- Woocommerce purchase date [closed]
- How to add a special Woocommerce “buy now” button?
- Woocommerce: Any way to list all products *without* a specific attribute?
- How to fetch woocommerce highest price and lowest price in custom template page?
- Filter by Price filter button not working
- porto theme pagination on woocommerce not working
- Adding preference buttons to main nav that persist via user sessions. (Woocommerce)
- Coupon for product / woocommerce
- How can I show “sold out” instead of “out of stock” for some products with particular tags and categories [closed]
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Urgent Validate Save-Post Hooks on Woo-commerce product entry form!
- Is doing a database query in Woocommerce efficient to only display posts from a certain category?
- Call product search from custom hook
- How to get cookie value?
- Woocommerce Disabling Auto Restocking for Cancelled Orders
- MySQL error or data corruption after database migration
- My products are showing “not in stock” and I don’t know why
- Woocommerce change the price of products in the database
- Woocommerce modifying the html on the checkout page?
- Pseudo class :before don’t working in a specific button
- How to speed up “My Account > Orders Page” on Site with More than 200,000 orders?
- Woocommerce – Shop can’t find products after domain name change
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- WooCommerce product details page category display
- Woocommerce – Default product image by user role
- WooCommerce product id as permalink
- Move woocommerce shop page image to left
- WooCommerce Tax Filter Not Working
- WooCommerce does not translate every string
- Woocommerce add a text field if specific option is selected
- Add suffix to price html does not work
- Get user active posts randomly
- Categories and products in cart Woocommerce
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- How Fragile Is DB if I Upload Completely Updated Files
- Broken 302 redirection for product subcategory (Woocommerce, Apache)
- Website Tablet Check Out Field Issue
- WooCommerce order created via REST – sending the date_created along
- How to allow registration only from a certain location?
- Add confirmation popup on place order button
- Get Third Level Categories WooCommerce
- Change WooCommerce Checkout Button – Reverts to normal
- Show pop up message for specific categoryies
- Send form data to functions.php
- How to remove content from hacked pages? [closed]
- Disable WooCommerce Address State Dropdown
- How to show detailed order history on woocommerce product page [closed]
- Adding a column to woocomerce admin order page that can be sorted
- WordPress error
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red