Tagged: $avia_config
-
AuthorPosts
-
November 18, 2016 at 2:06 pm #714002
I followed a previous thread with an addition to make a new size selectable with the media editor. This is my code I have in the enfold-child theme:
function avia_change_image_size_array() {
global $avia_config;
$avia_config[‘imgSize’][‘property’] = array(‘width’=>600, ‘height’=>400 , ‘crop’ => true);
$avia_config[‘selectableImgSize’] = array(
‘property’ => __(‘property’,’avia_framework’), // This is my new image size
‘square’ => __(‘Square’,’avia_framework’),
‘featured’ => __(‘Featured Thin’,’avia_framework’),
‘featured_large’ => __(‘Featured Large’,’avia_framework’),
‘portfolio’ => __(‘Portfolio’,’avia_framework’),
‘gallery’ => __(‘Gallery’,’avia_framework’),
‘entry_with_sidebar’ => __(‘Entry with Sidebar’,’avia_framework’),
‘entry_without_sidebar’ => __(‘Entry without Sidebar’,’avia_framework’),
‘extra_large’ => __(‘Fullscreen Sections/Sliders’,’avia_framework’),
);
}
add_action( ‘init’, ‘avia_change_image_size_array’);This hasn’t worked and neither my new image size or the enfold images sizes show in the media select drop down.
November 21, 2016 at 6:49 am #714683Hi jjma!
Thank you for using Enfold.
Please use the default add_image_size function. You can override the existing thumbnail size with it.
add_image_size( 'bigger-square', 250, 250, true ); add_image_size( 'widget', 60, 60, true ); // existing thumbnail sizeIf you want to add it in the selection, use the “image_size_names_choose” filter.
add_filter( 'image_size_names_choose', 'my_custom_sizes' ); function my_custom_sizes( $sizes ) { return array_merge( $sizes, array( 'bigger-square' => __( 'Bigger Square' ), ) ); }Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.
