There is a the_post
hook which should let you modify the post object:
function my_the_post_action( $post_object ) {
// modify post object here
}
add_action( 'the_post', 'my_the_post_action' );
But the post data isn’t where your thumbnails are stored. They are associated via a post meta field. That is what you are going to have to manipulate. Something like:
function my_thumbs($n, $object_id, $meta_key, $single ) {
if ('_thumbnail_id' == $meta_key) {
echo 'image link';
}
}
add_filter( "get_post_metadata", 'my_thumbs', 10, 4 );
Though I have no idea how complex that function would need to be.
Honestly, if you are running WP 2-something you need to update and spend the time converting your improvised system to Core functions. Sincerely.
Related Posts:
- Custom excerpt length filter doesn’t work
- How to generate numbers indistinguishable for the IDs of the posts
- Hook for changing excerpt content when excerpt not set
- Filter question list on substring of metavalue
- How enter custom post meta or custom field on box post list archive page?
- How to automate featured posts number? [duplicate]
- How to check if single.php has already called the_post_thumbnail function
- add to end of post in the loop with plugin
- Getting only the URL of the post thumbnail
- Add filter to the end of the post
- Remove Featured Image & All Media Uploaded to the Post
- Get post content with all filters applied, knowing post id
- Get Post’s first image using Short-code
- Customize rel=canonical tag for single blog post
- Change all author links in Blog roll
- How to I retrieve the ID from the Posts page?
- How to save meta checkbox WordPress
- Adding bootstrap classes to video shortcodes
- related author post thumbnail shows post thumbnail
- Is it possible to filter the main loop to exclude posts from a specific category?
- How to calculate the average of a post meta value(Numeric) of a specific author
- query post limits
- Is there any way to tell when wp_postmeta has been updated?
- Admin – no Featured image choice in create new/page|post
- Displaying post excerpt using wpdb query
- Post Image not displaying in category view
- preg_replace not removed “class”
- wpColorPicker – problem with implementation to post meta
- How to disable the_excerpt from one post
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- Modify posts listing at back end
- Filtering posts on Post Administration Page by Week Number instead of by Month
- Prevent posts with certain post_meta to be edited
- Change post author without using wp_update_post()
- Show metabox value last post excerpt, title and link
- Change the default blog post post attribute template name from “default template” to something else
- if in category but only with post meta
- Is it possible to add a shortcode below post title?
- how to give multiple post thumbnails to a post
- Post filtering is returning blank page
- Change the number of excerpts displayed in search results layout
- wp_query with ajax
- Update post meta within save_post action
- Display post number by category
- Updating post meta for checkbox
- Saving Post Data in Another Database
- the_excerpt is displaying excerpts of every post
- Using wp-cli and delete everypost first image
- How to display post title inside thumbnail?
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- How include css class based on post ( in loop ) slug?
- Custom permalink for each post
- How can I tell if a post has been published at least once?
- Restrict displaying posts to the poster itself (in Back-end)
- Why excerpt is Displaying same in Random Posts list
- Is there a way getting post fields using `transition_post_status`
- Post Title to featured Image ALT
- Automatic blog page with custom design [closed]
- Add multiple meta keys to a post at once
- Show number of posts by logged in user
- How does WP decide how to display a page
- Get featured image on hover of post title [closed]
- Exists filter or action that change Add New Post link?
- When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Insert data from custom created PHP page into wp_postmeta table
- Adding a meta box to determine the sidebar [closed]
- The loop starting at a certain ID
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- saving/reading custom field value does not work – no value gets POSTed
- Simple Custom Metabox Not Saving
- Remove Featured Image from posts in specific category?
- Get post category as a separate string and url
- Retrieve a specific post’s featured image and show on a different page
- Only show featured image on exerpt and exclude images in post
- changing parent_id on post
- WordPress Excerpt Paragraph Limiting
- How to display Post title By ID and its Thumb Contents
- wp_list_categories() Exclude All Categories Except One
- Grab value of excerpt_length
- Get current taxonomy and display query accordingly
- Calling Permalinks With PHP
- Trying to exclude custom posts based on date, while sorting by custom field
- can’t modify post title using the_posts filter
- Show only posts with titles/permalinks that do not contain certain words
- How do I display main query posts in random order using add_filter
- How to Remove HTML Elements from Post Excerpt?
- Featured Images most often doesnt appear
- How to add text before post_excerpt in Gutenberg
- Rewrite image links from attachment id to attachment link
- Post meta not working
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- Delete media from the post but keep my featured image and post
- Using AJAX to filter posts without refreshing page
- Why is WordPress showing a blank excerpt for just one of my posts?
- How to bulk Update URLs to new values?
- Select another post in a post meta like a parent page is selected while editing a page
- SQL DELETE multiple post_meta on single and multi-sites
- Filter posts by month (dropdown)