• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

add_image_size not working

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › add_image_size not working

This topic is: not resolved

Tagged: custom image sizes, image, media

  • This topic has 10 replies, 4 voices, and was last updated 9 years ago by MissKitty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • March 7, 2015 at 3:21 am #143558
    trash
    Participant

    Hello,
    I want to add new image sizes to my WP install. I have written the following line in my functions.php of my child theme:

    //Add Image Size
    add_image_size( 'greyarticle-thumb', 214, 214, true );

    But when I upload a new image, WP creates the usual three versions of the image, without creating an image that is 214x214px.

    Am I missing something? I also tried it this way, but even this does not work.

    //Image settings
    add_action( 'after_setup_theme', 'custom_theme_setup' );
    function custom_theme_setup() {
      add_image_size( 'greyarticle-thumb', 214, 214, true );
    }

    Is there something missing on my server? How can I check this?

    Thanks!

    March 7, 2015 at 3:24 am #143559
    Brad Dalton
    Participant

    Should work, for new images only. Here's the full docs http://codex.wordpress.org/Function_Reference/add_image_size


    Tutorials for StudioPress Themes.

    March 7, 2015 at 3:29 am #143561
    trash
    Participant

    Hey braddalton,
    thanks - I looked in the Codex. I just found out, that on the FTP I have the image in size 214x214, but the Dropdown-List when I want to insert the Image in a Post is missing that size.

    How can that happen? Did I miss any setting which adds 214x214 to the dropdown menu?

    March 7, 2015 at 4:06 am #143562
    Brad Dalton
    Participant

    Are you using both code snippets in your functions file or just one?

    It should work with one line like this:

    add_image_size( 'slider', 1140, 445, TRUE );
    

    Is there any server side caching?


    Tutorials for StudioPress Themes.

    March 7, 2015 at 4:47 am #143566
    trash
    Participant

    I pasted both examples which I tried, but when checking of this works I am just using one code snippet at a time.

    Isn't it strange, that the files get created, but the dropdown does not show the size at all....hm

    March 7, 2015 at 5:56 am #143567
    Brad Dalton
    Participant

    Yes, especially if you're only using the first line of code.


    Tutorials for StudioPress Themes.

    June 10, 2016 at 1:15 pm #187339
    MissKitty
    Member

    Hi guys - I'm having the same issue. I've added a custom size and regenerated thumbnails:
    add_image_size( 'medium-small', 200, 200, TRUE );//custom jlr
    and I can apply the custom size using the text editor, but the custom size doesn't show up in any drop-down (media or media gallery).

    Any update on this?

    June 10, 2016 at 1:29 pm #187343
    Victor Font
    Moderator

    There's one more step you have to take is you want the image to appear in the drop down: http://victorfont.com/add-custom-image-sizes-to-media-library/

    function post_image_sizes($sizes){
        $custom_sizes = array(
            'greyarticle-thumb' => 'Grey Article'
        );
        return array_merge( $sizes, $custom_sizes );
    }
    add_filter('image_size_names_choose', 'post_image_sizes');

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    June 10, 2016 at 1:33 pm #187346
    MissKitty
    Member

    Oh my word, you are a GENIUS, Victor 🙂
    A million thank you's, that worked like a charm

    June 10, 2016 at 2:05 pm #187360
    MissKitty
    Member

    Oops one other question, how would I edit the extra code if I had more than one custom thumbnail size?
    thanks in advance.

    June 10, 2016 at 2:18 pm #187361
    MissKitty
    Member

    My apologies - I figured it out! 🙂

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble