Problems with Featured Images

Home Forums WordPress Themes – Premium Encounters Problems with Featured Images

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16991

    I’ve just started using the “excerpt” setting for my blog posts, and I have chosen “small image” in the Intro Image selector. But, I’m having trouble getting the featured images to work. When I go to my media library, I can see in the metadata that WordPress is uploading the full-sized image (for inside the post) as well as a thumbnail for each image. However, on my homepage, Encounters is displaying the full-sized image instead of the thumbnail.

    Here is a link to the full text of my latest post:

    http://www.lecarmichael.ca/geeks-nerds-big-bang-theory/

    Here is the link to the homepage:

    http://www.lecarmichael.ca/

    Any advice for fixing this problem is much appreciated. Thank you!

    #22367
    Sushil Adhikari
    Moderator

    Hi Lindsey Carmichael,

    As per our understanding you are supposed to display small featured image ,on home page.
    Here we are providing you a two methods to solve your issue, it’s will depend on you , which one you feel comfortable to follow:

    Case1: Please add this following css on child theme style.css file:

    .home img.alignleft {
    	max-width: 50%;
    	max-height: 50%;
    }

    Note: You can change max-width and max-height value as per your requirement.

    case2:
    If you are technically sound on WordPress programming then only follow this steps.
    Bring content.php templates from parent [site folder-> wp-content->themes->encounters->content.php] and paste it inside child theme[site folder-> wp-content->themes->encounters-child->content.php].
    In content.php you will find this code,

     'alignnone'));
    				break;
    				case "small" : 
    					the_post_thumbnail('', array('class' => 'alignleft'));
    				break;
    			} 
    		endif; ?>

    Replace this code with this following code :

    
     'alignnone'));
    				break;
    				case "small" : 
    					the_post_thumbnail('medium', array('class' => 'alignleft'));
    				break;
    			} 
    		endif; ?>
    

    To know more on post thumbnail: please see https://developer.wordpress.org/reference/functions/the_post_thumbnail/

    Note: Please use child theme to add this css, otherwise your changes will be lost on theme update.
    Please let us know if we are understanding you fully or if perhaps this is not what you meant.

    We look forward to your response

    #22391

    I modified the content.php file with the code you suggested. Do I need to add additional info at the top of the file to indicate it is a child?

    #16992
    Sushil Adhikari
    Moderator

    Hi there,

    You can describe the file in this way, this is just description of file name .
    /**
    * Pure and Simple child content.php
    * @package Pure_and_Simple child
    * @since 1.0.0
    */

    If you are feeling difficulty on coding , then please use css given on previous reply, this also works perfectly.

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.