Archived topic
Featured Image Default Size on Single Post
25 replies · Started by Bruce on September 12, 2016
Hi there,
I'm not too sure what you mean - do you have any examples?
I'm in the request for the custom-size image single-post
This post should help then: https://generatepress.com/forums/topic/featured-image-default-size-on-single-post/#post-233803
If you don't use one of the WP generated sizes (full, medium, thumb), you can create your own:
add_action('after_setup_theme', 'tu_add_image_sizes');
function tu_add_image_sizes()
{
add_image_size( 'custom-image-size1', 300, 9999 ); //300 pixels wide (and unlimited height)
add_image_size( 'custom-image-size2', 220, 180, true ); //(cropped)
}
I would also like this feature! :-)
Right now I have my front page showing latest posts, 2 columns and full width on first post.
With the blog plugin i have a specified width and height on post image and it looks very nice.
But I want the single post featured image to be the same size as the latest post on the front page. This will enhance the feeling of consistency across the website. If that makes sense :-)
Thanks, Karl!
My "road-block" was that if you set a width and height in the Customizer for single featured images, then the page header options would conflict.
I suppose I could write a conditional that uses the Customizer option as long as the resize options in the page header meta box aren't set.
Will look into getting this added :)
Cool!
For now I just upload images with exact dimentions.
Thanks
No problem :)
Adding my voice to this as a request! I've successfuly changed the dimensions of the image on an archive page, or blog homepage to a uniform 700x300, but would like that to be true on the inside single post as well! Thanks!
Like to set a dimension for featured image in single posts?
If so you can try some CSS for now:
.page-header-image-single {
max-width: 700px;
}
Hi Leo! Thanks for that. I'm looking for a precise 700x300 dimension. It works like a charm on the frontpage and archive page etc) as seen here: https://scienceblog.com/
My goal is to learn how to implement that uniformly on all single posts as well.
That case I would recommend cropping the picture to the exact dimension instead of using CSS.
You can try this CSS but you wouldn't be able to control the ratio or where the image is cropped. Same reason why we usually only specify the width and let the height be scaled automatically.
.page-header-image-single {
width: 700px;
height: 300px;
}