Beaver Builder and Simple Image Sizes don’t like each other

I had a variety of custom image sizes that I defined by using the plugin Simple Image Sizes (which, by the way, is really easy to use and a time-saver if you don’t want to muck with code). When I used Beaver Builder to rebuild the site I’m currently working on, I found that I could no longer select from those custom sizes when using the Media tool. I deactivated that plugin and just did it in code by adding this to functions.php:

Not to say that the problem is with Beaver Builder; it could just as easily be a problem with Simple Image Sizes. Since that plugin is pretty popular and I probably won’t be the one to have this problem, I thought I’d share the solution.

WordPress code reference here, if you’re wondering how to set parameters for size and crop

6 Comments

  1. Brent Jett on October 17, 2015 at 11:44 am

    Yes, I’ve run across the same thing, or at the very least, Beaver Builder shows “undefined” as the image size name but the size is still usable. I’m not crazy about Simple Image Sizes because I think the UI could be better, but it looks like the best thing out there right now if you don’t want to dig in and write the add_image_size calls yourself. I’m sure the beaver builder guys would consider it out of scope but it might be a really nice thing to have custom image sizes defined or even suggested by BB based on the available space for images. In the meantime, this combo still works well enough for me.



    • Dave Kuhar on October 22, 2015 at 8:29 pm

      Agreed, that plugin’s UI leaves something to be desired. It’s been a good tool if I’m feeling lazy, though now that I’m working almost exclusively in Beaver Builder I pretty much have to use the code shown here.



  2. Jordan on January 17, 2017 at 1:03 am

    Hi there,

    I modified the sizes and names of your code and inserted in my functions.php, but whenI checked the media insertion drop down in one of the modules. Those custom sizes were not present.

    Here’s the code used:

    // Add custom image sizes
    add_image_size( ‘Header Image’, ‘1120’, ‘300’, array( “1”, “”) );
    add_image_size( ‘Hover Card’, ‘700’, ‘250’, array( “1”, “”) );
    add_image_size( ‘Full Width Footer’, ‘1920’, ‘500’, false );
    add_image_size( ‘featured-image’, ‘350’, ‘200’, false );

    // Add custom image sizes to Media insertion dropdown menu
    add_filter(‘image_size_names_choose’, ‘xmit_image_sizes’);
    function xmit_image_sizes($sizes) {
    $addsizes = array(
    “header-image” => __( “Header Image”),
    “hover-card” => __( “Hover Card”),
    “full-width-footer” => __( “Full Width Footer”)
    );
    $newsizes = array_merge($sizes, $addsizes);
    return $newsizes;
    }



    • Dave Kuhar on January 18, 2017 at 2:32 pm

      Hmm. Looks like you’re right, it’s not working for me either. I’ll have to look into this and see what I can come up with.



      • Dave Kuhar on January 18, 2017 at 2:51 pm

        Okay, I shamelessly lifted some code that works from the old BB forums and updated the post. So if you go back to the top and try the code that’s there now you should be good to go.

        (BB forum post for reference)



        • Jordan on January 18, 2017 at 4:04 pm

          Yep me too. Thanks.