#37729 closed defect (bug) (duplicate)
get_post_thumbnail_id doesn't work in post preview
| Reported by: | nightcoder | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Post Thumbnails | Version: | 4.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
WooCommere preview page