Viewing 16 posts - 1 through 16 (of 16 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 6 months, 1 week ago by  kbarranco.
    #279273

    Hi!

    You can modify Josues code here: http://www.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

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

You must be logged in to reply to this topic.