Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
  • #274226

    The featured image for a single post appears to be displayed at the same height and cuts off the top and bottom of an image. How do you set the featured image so that the whole image is displayed on the single post instead?

    My current theme configuration is:
    Enfold Theme Options > Blog Layout > Single Post Options > Single post with big preview image

    Current image size uploaded: 1066 w x 600 h

    However, the image height is cropped in the single post to about 360px.




    Open and look for line:

    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1030, 'height'=>360 );						// images for fullsize pages and fullsize slider

    Replace it by this:

    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1066, 'height'=>600 );						// images for fullsize pages and fullsize slider

    After you done that, regenerate the thumbnails:



    The problem with that approach is that it assumes that all featured images will be uploaded at the same size.


    Well, that’s how it’s intended to work.

    However, there is a way to change that, open includes/loop-index.php and look for line 34:

    $current_post['slider']  	= get_the_post_thumbnail($current_post['the_id'], $size);

    Change it to:

    $current_post['slider']  	= get_the_post_thumbnail($current_post['the_id'], "full");



    Thanks. It would be good if that were an option in the Blog Layout section of the theme options rather than having to update the source. I’m sure that change will be gone the next time an update is pushed out.


    Not necessarily, you can have this mod in a child theme. A duplicate of includes/loop-index.php in the child folder will do the trick.



    What happens if you make changes to the loop-index file in the next Enfold release? How would these be reflected in the child theme? Thanks.


    The thing is that doesn’t happen too often, but if it does you would need to merge it which is not a big deal, after all the mod is just a line change.



    True… but only as long as I remember the change. :)


    Hehe, that’s how things work right now, feel free to request it here as a feature for future updates.

    If you have any additional questions please let me know :)



    i was trying to follow this and got confused. I don’t know what size to make the image for single post. Won’t it scale from there?


    Please elaborate on your issue @kbarranco.



    my image is too big:
    I would like to make the image more narrow, but how will it look on the homepage if my client uploads an odd shaped image?

    • This reply was modified 4 years, 9 months ago by  kbarranco.


    You can modify Josues code here: (Purchase code hidden if logged out) -height-in-single-post/#post-274245 and use a different thumbnail size for single posts.


    $current_post['slider']  	= get_the_post_thumbnail($current_post['the_id'], $size);


    $size = (is_single()) ? "square" : "full";
    $current_post['slider']  	= get_the_post_thumbnail($current_post['the_id'], $size);

    You can replace “square” with another thumbnail size like ‘masonry’, featured’, ‘featured_large’, ‘portfolio’, ‘gallery’, ‘entry_with_sidebar’,’entry_without_sidebar’,extra_large’ or “magazine”.

    Best regards,


    ok- I’ll have to sit with this a while. I am not a programmer and sometimes this hurts my brain ;)



    Please let us know if it works. We added a conditional statement on $size variable that will assign a different thumbnail size, square in this case, on the slider. As Dude described, you can use different thumbnail size. If you want to know where these thumbnails are coming from, check functions.php, find this codes:

    $avia_config['imgSize']['widget'] 			 	= array('width'=>36,  'height'=>36);						// small preview pics eg sidebar news
    $avia_config['imgSize']['square'] 		 	    = array('width'=>180, 'height'=>180);		                 // small image for blogs
    $avia_config['imgSize']['featured'] 		 	= array('width'=>1500, 'height'=>430 );						// images for fullsize pages and fullsize slider
    $avia_config['imgSize']['featured_large'] 		= array('width'=>1500, 'height'=>630 );						// images for fullsize pages and fullsize slider
    $avia_config['imgSize']['extra_large'] 		 	= array('width'=>1500, 'height'=>1500 , 'crop' => false);	// images for fullscrren slider
    $avia_config['imgSize']['portfolio'] 		 	= array('width'=>495, 'height'=>400 );						// images for portfolio entries (2,3 column)
    $avia_config['imgSize']['portfolio_small'] 		= array('width'=>260, 'height'=>185 );						// images for portfolio 4 columns
    $avia_config['imgSize']['gallery'] 		 		= array('width'=>710, 'height'=>575 );						// images for portfolio entries (2,3 column)
    $avia_config['imgSize']['magazine'] 		 	= array('width'=>710, 'height'=>375 );						// images for magazines
    $avia_config['imgSize']['masonry'] 		 		= array('width'=>705, 'height'=>705 , 'crop' => false);		// images for fullscreen masonry
    $avia_config['imgSize']['entry_with_sidebar'] 	= array('width'=>710, 'height'=>270);		                 // big images for blog and page entries
    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1030, 'height'=>360 );						// images for fullsize pages and fullsize slider




    This is all great but what happens with the changes in functions.php when Enfold is later updated?
    I’m using child-theme but when I insert the above functions in the child themes functions.php they don’t work. They only work in parent theme functions.php.



    @grafixstudio: What is the code that you used? Which one is not working?

    Best regards,


    Hi, after hour and hour I find the Josue’s advice, that is a solution for my problems. Is there a way to obtain same result ( full size featured image) on mobile version of my site? Thanks



    @aka-alex: Please create a new thread or post then provide the url to the page. The modification above should affect the desktop and the mobile view as well.

    Best regards,


    Thanks for all Ismael



    We replied in your own thread: (Purchase code hidden if logged out) -on-mobile/

    We’ll close this thread now.

    Best regards,

Viewing 22 posts - 1 through 22 (of 22 total)

The topic ‘How to adjust featured image height in single post’ is closed to new replies.