Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #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.

    #714683

    Hi 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 size
    

    If 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' ),
        ) );
    }

    // https://kriesi.at/support/topic/impossible-to-use-custom-image-sizes-in-slider-accordeon/#post-574335

    Regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.