[Resolved] Create Custom Image Sizes

Home Forums Support [Resolved] Create Custom Image Sizes

Home Forums Support Create Custom Image Sizes

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #360904
    Roger

    Hi,

    This is my first post on here, I’m using GP and Elementor Pro. I’m fairly new to both.

    I’m creating a new Artist Portfolio site and would like to have some custom image sizes to use when setting up galleries in Elementor – I’m an artist/designer so not a coder so is there an easy way to do this please?

    cheers!

    #361049
    Leo
    Staff
    Customer Support

    Hi there,

    Not quite sure what you are after?

    If this is to be done with Elementor then it might be better to ask their support.

    Let us know ๐Ÿ™‚

    #361113
    Roger

    hi Leo, sorry, i mean in the WordPress media library/uploader you have a dropdown menu with a selection of sizes for images and this is the same in Elementor so I’dd like to be able to set my own custom sizes…

    cheers

    #361140
    Leo
    Staff
    Customer Support

    You should be able to use Scale Image in Edit Media through WordPress: https://codex.wordpress.org/Edit_Media#Edit_Image

    #361160
    Roger

    Thanks, but thats not what i mean – I’ve seen some themes like customizr i built my first site with has a whole list of custom sizes you can choose to use for that image when you add it to a site in WP but in GP I only have the default sizes that WP uses to resize. The main issue is in elementor I want to have a square image format to control sizes in the Image Gallery Element – as the only options are
    Thumbnail
    Medium
    Medium Large
    Large
    Full

    thanks

    #361170
    Tom
    Lead Developer
    Lead Developer
    #361174
    Roger

    Thankyou,Tom, ill take a look!

    #361175
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚

    #361226
    David
    Staff
    Customer Support

    Theres probably a lot of people using Elementor that will find that Action very useful. It surprised me that there wasn’t an option in Elementor…..

    #843904
    Shawn

    I just came across this string about custom image sizes. I’m also using the GP theme with Elementor. I need to create additional sizes beyond medium and large but I’m not clear about the add image size function. Based on Tom’s link above, does the size information go into the functions section of the parent or child theme?

    Thanks.

    #843944
    Tom
    Lead Developer
    Lead Developer

    It would go into the child theme ๐Ÿ™‚

    #844313
    Shawn

    Ok, thanks.

    #846121
    Shawn

    Tom,

    This worked great:

    add_action(‘after_setup_theme’, ‘tu_add_image_sizes’);
    function tu_add_image_sizes() {
    add_image_size( ‘horiz-med’, 800, 526, true ); // (cropped)
    }

    When I went back and added another image size by doing this:

    add_action(‘after_setup_theme’, ‘tu_add_image_sizes’);
    function tu_add_image_sizes() {
    add_image_size( ‘horiz-med’, 800, 526, true ); // (cropped)
    add_image_size( โ€˜vert-med’, 800, 1050, true ); // (cropped)
    }

    I then received this error message: syntax error, unexpected ”, 800, 1050, true ); // (crop’ (T_ENCAPSED_AND_WHITESPACE)

    What did I do wrong?

    #846138
    Tom
    Lead Developer
    Lead Developer

    Hmm, I’m not seeing anything wrong.

    Try this:

    add_action( 'after_setup_theme', function() {
        add_image_size( 'horiz-med', 800, 526, true );
        add_image_size( 'vert-med', 800, 1050, true );
    } );
    #846823
    Shawn

    I didn’t get an error message adding this code to the php functions.

    Thanks.

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