#37729 closed defect (bug) (duplicate)
get_post_thumbnail_id doesn't work in post preview
Reported by: | nightcoder | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6 |
Component: | Post Thumbnails | Keywords: | |
Focuses: | Cc: |
Description
The code returns the page/page's featured image id for all additional loops in the preview mode.
get_post_thumbnail_id( $post->ID )
It is pretty obvious when you click previewing a WooCommerce product, the "Related Products" thumbnails, WooCommerce related widgets, all of them will display the post's thumbnail.
If you remove the
_thumbnail_id=
part of the preview url, it works properly.
Attachments (1)
Change History (3)
#1
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Hi @nightcoder,
Thanks for the report. This is a duplicate of #37697, which has a patch that should address the problem. Please feel free to jump in on that ticket and test the latest patch, if you are able.
Note: See
TracTickets for help on using
tickets.
WooCommere preview page