Reply To: featured images not displayed in correct size

Home Forums WordPress Themes – Premium Encounters featured images not displayed in correct size Reply To: featured images not displayed in correct size

Sushil Adhikari

WordPress handles images very strangely, but the add_theme_support function is to enable the “Featured Image” functionality in the theme. The media settings is more for “inserting” images into a post or page but there is no way to choose the thumbnail size for the featured image unless the theme is specifically coded for a specific size. So what featured image you upload is the one you will get in your post.

You can customize the thumbnail code in the theme file(s) if you want, so definitely use a child theme for that (more on this in a moment).

How I did the demo website for the blog is that I simply created the thumbnails that I wanted in the size I wanted then uploaded them. So for a blog post, if I want my featured images to all be 200×100 px, then I make my featured images that size and upload it as I need one per post.

The file that puts the featured image in the post is the content.php file:

The code begins around line 52 and starts with:

<?php if ( has_post_thumbnail()) :

For adding a custom featured image size, you would definitely need to add a new function for the sizing. Here is a tutorial from one of the WP coders:

The function for this this them is found in the functions.php file around line 63

add_theme_support( 'post-thumbnails' );

To do this in a child theme, you will need to create a new functions.php file in the child theme and then add your new custom thumbnail code there. Also, I hope for this project of yours, you plan to do this on a test site location first. Please note that switching to a child theme means your theme option settings will have to be redone.