Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #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.

    Thanks!

    #274231

    Hi,

    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:
    http://wordpress.org/plugins/regenerate-thumbnails/

    Regards,
    Josue

    #274239

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

    #274245

    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");
    

    Cheers!
    Josue

    #274255

    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.

    #274258

    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.

    Regards,
    Josue

    #274266

    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.

    #274271

    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.

    Cheers!
    Josue

    #274273

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

    #274281

    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 :)

    Cheers!
    Josue

    #278387

    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?

    #278389

    Please elaborate on your issue @kbarranco.

    Regards,
    Josue

    #278392

    my image is too big: http://www.hatchnola.com/wk-kellogg-foundation-honor/
    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 10 years, 5 months ago by kbarranco.
    #279273

    Hi!

    You can modify Josues code here: https://kriesi.at/support/topic/how-to-adjust-featured-image-height-in-single-post/#post-274245 and use a different thumbnail size for single posts.

    Replace:

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

    with

    
    $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,
    Peter

    #279294

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

    #280989

    Hi!

    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

    Cheers!
    Ismael

    #675640

    Hello!

    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.

    #676777

    Hi,


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

    Best regards,
    Ismael

    #753172

    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

    #756197

    Hi!


    @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,
    Ismael

    #756339

    Thanks for all Ismael

    #756733

    Hi!

    We replied in your own thread: https://kriesi.at/support/topic/show-different-featured-image-slider-on-mobile/

    We’ll close this thread now.

    Best regards,
    Ismael

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.