Auto Insert Featured Image On WordPress Themes That Doesn’t Support Post Thumbnails

There are many WordPress themes like Twenty Fourteen etc that automatically shows post thumbnail i.e. featured image on single post screens. But in general most WordPress themes shows featured image only on blog and multi-post pages and some WordPress themes doesn’t displays featured images anywhere. 

In this lesson you will learn about automatically inserting featured images before post content so that you can show them on your website even if your theme doesn’t supports any featured image functionality.

Thumbnail Before Content is the new WordPress plugin that does the thing. Simply install and activate it on your WordPress website and your website will start to show featured images. At present no styling is done by default, but as said by the developers styling options will be added in a future version of this plugin.

The plugin works over a simple PHP hack and hence if you want you can alternatively use the following code in your theme’s function.php file:

add_filter( ‘the_content’, ‘thumbnail_before_content’);
function thumbnail_before_content($content) {
global $post;
$new_content = ‘<p>’ . get_the_post_thumbnail( $post -> ID, ‘full’ ) . ‘</p>’;

return $new_content . $content;
}

And it will start to show featured images on single and multi-post screens of your WordPress website.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.