Instead of inserting a new column with a featured image on it, I would like to put the featured image under the post's already existing title. I can't seem to figure out how you insert things on the title property however. Achieving this:
I've found this post: How can i place Feature Image under title field in wp-admin?
With a snippet that I can't get to work. Otherwise there are lots of solutions for adding new columns with featured images in them.
I've arrived at something like this:
add_action('admin_head-edit.php', function(){
add_filter('the_title', function( $title, $id ) {
return $title . get_the_post_thumbnail_url();
}, 100, 2);
});
But if I use get_the_post_thumbnail_url
the url is embedded as part of the title, and if I use the_post_thumbnail( 'thumbnail' )
it renders the image twice.
return $title . get_the_post_thumbnail('thumbnail');
?the_post_thumbnail
I saidget_the_post_thumbnail
. They are 2 different things.