Hello Jag,
That would only be possible via a child theme.
How comfortable are you with PHP/CSS code?
Regards,
Zulf
Hi,
more or less I get it.
The problem can be in this part?
@media screen and (min-width: 1040px) {
.site-content .has-post-thumbnail .entry-header {
margin-top: -48px;
}
JAg
No, that part pulls the content up so it slightly overlaps the featured image – a design decision.
To change the featured image sixes you’d be looking at changing the set_post_thumbnail_size and add_image_size values in the after_setup_theme function callback.
You’d then apply the new values to the output via the child theme’s template-tags file using a custom function callback.
Hope that makes sense and points you in the right direction.
Regards,
Zulf
Oh, thanks!
In functions.php I have however 2 sizes already. Maybe the name the smalled one should be changed into”featured image”? Or should be added px after numbers?
add_theme_support( ‘automatic-feed-links’ );
// Enable support for Post Thumbnails, and declare two sizes.
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size( 672, 372, true );
add_image_size( ‘ridizain-full-width’, 1380, 770, true );
add_image_size( ‘ridizain-recentpost-thumb’, 372, 186, true );
JAg
I think we’re looking for the same set of instructions on how to actually change those defaults – my thread is here:
http://ww.wp.xz.cn/support/topic/set-standard-featured-image-size
Just changing the sizes in that code in a Child Theme’s function.php file does not change how the images are displayed. Changing the values in the original theme files would, but that defeats the purpose of using a Child Theme at all! So, Zulf, can you please point us to instructions on how to make changes to that functionality in a Child Theme?
(cross posted to my original thread as well)
Solution!
This page was very helpful: https://codex.ww.wp.xz.cn/Plugin_API/Action_Reference/after_setup_theme
/* Set Default Featured Image Sizes */
add_action( 'after_setup_theme', 'ridizain_setup' );
function ridizain_setup() {
// Enable support for Post Thumbnails, and declare two sizes.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 400, 300, true );
add_image_size( 'ridizain-full-width', 600, 400, true );
add_image_size( 'ridizain-recentpost-thumb', 250, 250, true );
}
You have to keep “ridizain_setup” named exactly that for it to override what’s in the original theme functions.php file. The values you choose in the size lines can be whatever you want.