• Hi everybody.

    First of all I thank all the Automattic team for your great releases.

    What’s more? I have a question. Is it possible to make the home featured images size fixed?

    I really like this theme, but I need to crop or resize every featured image.

    Is there any tip?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Glad you’re enjoying our themes!

    Is it possible to make the home featured images size fixed?

    Syntax defines featured-image sizes in its setup function – syntax_setup() – which is found in functions.php:

    /**
    	 * Enable support for Post Thumbnails on posts and pages
    	 */
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( '1008', '9999' );

    This means that the width is 1008, while the height is variable, depending on your original image.

    You could experiment in a child theme with changing the value for height instead to be a fixed size.

    You’ll need to first set up a child theme, and create a blank plain-text file called functions.php. You’ll then add an opening PHP tag at the very top: <?php and copy in the entire setup function from the parent theme’s functions.php, starting with:

    if ( ! function_exists( 'syntax_setup' ) ) :

    and ending with:

    add_action( 'after_setup_theme', 'syntax_setup' );

    After you’ve activated your child theme, you’ll need to use a plugin to regenerate your thumbnail (featured) images at the new size:
    https://wordpress.org/plugins/regenerate-thumbnails/

    I haven’t tested this but why not give it a try and let me know how it goes.

    Thread Starter Asakasan

    (@asakasan)

    Wow!!!

    Thanks a lot for your step-by-step tutorial! You’re really nice!

    I’ll test your instructions as soon as possible, and I’ll let you know!

    Thread Starter Asakasan

    (@asakasan)

    Hi Kathryn, here I am again!

    I’ve tried your solution, but it don’t seem to work.

    Summing up what I did:

    1 – I’ve set up my Syntax child theme.

    2 – I’ve created the functions.php file following your instructions.

    3 – I’ve activated Syntax child theme.

    4 – I’ve activated the plugin you suggested.

    But, even if the plugin works fine (I’ve just checked in my Media Library and my images are now regenerated at the new size), in the blog pages nothing has changes: images are of different sizes as before, and not a bit regenerated compared to the way they were.

    I’ve checked for some mistakes in my child theme or functions.php file, but everything seems to be right.

    Another question: i’d like my images to be of the same height, not only same width. Is it possible?

    Thanks a lot for your help! 🙂

    At this stage I think it would be helpful to have a look at your site directly – could you please provide a link? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Featured images size’ is closed to new replies.