Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Need help with add_image_size()

Discussion in 'Misc WordPress Requests' started by figure2, Nov 30, 2017.

  1. figure2

    Guest

    Need help with add_image_size(), by figure2

    Greetings,

    I created a function to add custom image sizes to the image editor window. The names of the new image sizes have been added but the image dimensions inside the add_image_size() function have been ignored. I have no idea where the sizes in the image editor window came from.

    Here is the code:

    if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'featured-image-500', 500, 250 );
    add_image_size( 'x-large-thumbnail', 200, 200 );
    add_image_size( 'medium-plus', 390, 390 );

    }
    function extra_image_sizes( $sizes ) {
    return array_merge( $sizes, array(
    'featured-image-500' => __( 'Featured Image 500px' ),
    'x-large-thumbnail' => __( 'X-tra Large Thumbnail' ),
    'medium-plus' => __( 'Medium Plus' ),
    ) );
    }
    add_filter( 'image_size_names_choose', 'extra_image_sizes' );

    Here is what I am seeing in the image editor window.

    What am I missing?

    Need help with add_image_size()
     
    #1

Share This Page

Web Hosting