Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add Custom Featured Image Size
Tagged: featured image
- This topic has 8 replies, 4 voices, and was last updated 8 years, 11 months ago by Josh Fialkoff.
-
AuthorPosts
-
December 16, 2013 at 3:50 am #79431Tim AMember
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
December 16, 2013 at 4:17 am #79435Tim AMemberI 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!
December 16, 2013 at 5:54 am #79436stinkykongParticipantIt 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.comDecember 16, 2013 at 6:20 am #79439Tim AMemberYes, 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 );
December 16, 2013 at 7:13 am #79447stinkykongParticipantCan you try uploading your featured image again? See if WordPress resizes for your newly added dimensions.
Web Design by Websentia Web Services
http://websentia.comDecember 16, 2013 at 7:58 am #79458Tim AMemberYes, 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!
January 4, 2014 at 9:35 am #83130Henrik BlomgrenMemberWhen 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.
January 5, 2014 at 8:19 pm #83451Tim AMemberAwesome 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!
May 12, 2015 at 6:17 am #151836Josh FialkoffMemberCan this method be used to let an editor choose a custom size on a per page/post basis when adding a new featured image?
-
AuthorPosts
- The topic ‘Add Custom Featured Image Size’ is closed to new replies.