Tagged: child theme, enfold, functions, functions.php, image sizes, media, media library, plugin
-
AuthorPosts
-
December 17, 2013 at 11:36 pm #201325
Hi guys…
What is your recommended way to add additional crop sizes for Enfold upon upload into the media library?
I’m trying to do it via this method in my child theme’s functions.php but it’s not working when I initiate the Regenerate Thumbnails plugin’s process (entire functions.php below):
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ /* Excerpt Length */ function new_excerpt_length($length) { return 50; } add_filter('excerpt_length', 'new_excerpt_length'); /* Additional Image Sizes by KB */ add_image_size( 'small-size-p', '300', '400', true ); /* portrait */ add_image_size( 'small-size-l', '400', '300', true ); /* landscape */ ?>
Would you suggest a plugin or function?
Thanks in advance!
GRAPHICpilot
December 18, 2013 at 1:32 am #201339Hey K!
You’ll need to re-add in the entire parent function with your new sizes in the array. For reference: https://kriesi.at/support/topic/generate-new-image-sizes-in-child-theme/?replies=4#post-125496
Best regards,
DevinDecember 18, 2013 at 10:32 pm #201711Devin,
Thanks a ton for your fast response… I’m still not following though. Here’s what I put in my child theme’s functions.php from what I understood from your linked article and the article you linked to in that thread. But I’m still not getting the image size in the selectable list:
function avia_change_image_size_array() { global $avia_config; $avia_config['imgSize']['small_portrait'] = array('width'=>300, 'height'=>400); $avia_config['imgSize']['small_landscape'] = array('width'=>400, 'height'=>300); } add_action( 'init', 'avia_change_image_size_array');
Would you mind modifying my snippet so that it’s included in the insert image drop-down of sizes?
Thanks man!
KylerDecember 19, 2013 at 11:21 am #201978Hi!
WordPress will not include the avia_config thumbnail sizes in the “insert image” dropdown but it will only list them on theme option pages (i.e. template/layout builder, etc.). You can try to use this plugin though: http://wordpress.org/plugins/simple-image-sizes/ which registers the thumbnail sizes in a different way
Cheers!
Peter -
AuthorPosts
- The topic ‘Enfold: How to add Additional Image Sizes to automatically be cropped at upload’ is closed to new replies.