Add Custom Featured Image Size

Community Forums Forums Design Tips and Tricks Add Custom Featured Image Size

This topic is: resolved

This topic contains 7 replies, has 3 voices, and was last updated by  Tim A 9 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #79431

    Tim A
    Member
    Post count: 4

    Hi,

    I am trying to add a custom featured image size. I have looked around and even tried a few tutorials I’ve found for Genesis pre version 2.0 but they haven’t worked for me. I have tried to add the snippet I found here http://my.studiopress.com/snippets/images/. This added the sizes to my Genesis Theme Settings panel but when I viewed it on my site it just broke the existing size that was set without adding the new custom size. In short – didn’t work.

    I am using the Genesis Sample Child Theme – Genesis 2.X

    Anyone have any advise or s snippet of code that can get this working for me?

    Thanks in advance!

    Tim

    #79435

    Tim A
    Member
    Post count: 4

    I should also mention that I would like to add the custom image size(s) without editing the themes files if possible to assure updates don’t break anything. Thanks!

    #79436

    stinkykong
    Participant
    Post count: 171

    It is set up so that updates won’t break your child theme. The method mentioned in you link will do fine. Use the method mentioned in your functions.php file and be sure you have a back-up of your site before you begin.


    Web Design by Websentia Web Services
    http://websentia.com

    #79439

    Tim A
    Member
    Post count: 4

    Yes, I tried using the method I mention in the link. It does add the ability to select the custom size from my Genesis Theme Settings but it does not make the corresponding changes on my site. It ends up breaking the featured image size and the featured image displays at whatever size the actual image is.

    It seems to me like a step is missing. Just adding this code is only half of what I need to do…

    <?php
    //* Do NOT include the opening php tag
     
    //* Add new featured image sizes
    add_image_size( 'home-bottom', 150, 100, TRUE );
    add_image_size( 'home-top', 400, 200, TRUE );
    #79447

    stinkykong
    Participant
    Post count: 171

    Can you try uploading your featured image again? See if WordPress resizes for your newly added dimensions.


    Web Design by Websentia Web Services
    http://websentia.com

    #79458

    Tim A
    Member
    Post count: 4

    Yes, it seems to work on newly uploaded images. Nice! <–thanks for that

    Note – it does not work if I try removing featured image and adding the same one back without uploading it again.

    Well, that seems to solve that problem and brings up a new one. What happens in the future if we decide we want to change the featured image size? We would have to go through each blog post individually and re-upload each featured image. Think there is a workaround for this or am I missing something?

    Thanks for your help!

    #83130

    Henrik Blomgren
    Member
    Post count: 31

    When you add a new featured image size it will as you noticed only work on newly uploaded images. For the old images one solution is to re-upload them all.

    Or as there most often are there exists a plugin that does just this for you, regenerates the thumbnail images to contain all of the sizes that you have in your media settings and for those sizes that you have set in the functions.php file

    You can find it here: http://wordpress.org/plugins/regenerate-thumbnails/. I´m using this whenever I change image sizes for the local themes I develop or when I change themes to get all thumbnails to be as I want them to.

    #83451

    Tim A
    Member
    Post count: 4

    Awesome Henrick, thanks for the recommendation. This plugins seems to be a great alternative to re-uploading all your images again.

    Thanks again stinkykong for your help as well!

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

You must be logged in to reply to this topic.