WordPress.org

Ready to get started?Download WordPress

Forums

Easy Image Gallery
[resolved] Increase image size (Settings > Media not sufficient) (7 posts)

  1. meltdown2
    Member
    Posted 9 months ago #

    My site: inspiredmosaics.co.uk/residential/

    I would like the large-size images displayed in the lightbox to be larger. However, increasing the setting in Settings > Media is not working. I suspect that my theme is restricting it.

    I see that you recommend the "add_image_size" option. Can you provide the code to achieve this? I would like the default height to be 635px.

    Thank you!

    http://wordpress.org/plugins/easy-image-gallery/

  2. sumobi
    Member
    Plugin Author

    Posted 9 months ago #

    When you increase the size of images in settings > media, you need to regenerate the images, they don't just automatically get resized. Did you do that? There's a couple of great free plugins that can do this for you such as http://wordpress.org/plugins/regenerate-thumbnails/

    If you still want to add a new image size let me know. Are you comfortable with pasting in PHP code to your child theme's functions.php and making changes?

  3. meltdown2
    Member
    Posted 9 months ago #

    Thanks for your response. Yes, I have the regenerate-thumbnails plugin installed. However, my problem is as follows:
    At Settings > Media I increase the image size, and then save. It indicates that the settings have been updated but in reality each time it defaults back to the previous settings. This happens even if I attempt to increase it by 1px. I suspect that my theme is restricting it, and hope that the "add_image_size" option will override it.

    Yes, I am comfortable with accessing functions.php, pasting php code, etc.

    Thanks again for your great support!

  4. sumobi
    Member
    Plugin Author

    Posted 9 months ago #

    Ahh yes, sounds like your theme is setting it somewhere and using set_post_thumbnail_size. You could always hunt through your theme for set_post_thumbnail_size or the word's "thumbnail" or "medium", which would reveal some code.

    Here's a tutorial on using add_image_size
    http://wp.tutsplus.com/tutorials/theme-development/using-custom-image-sizes-in-your-theme-and-resizing-existing-images-to-the-new-sizes/

    Once you have your new image size, take note of the name that you gave it, which is the first parameter within the function.

    Then you'll need one more function to change the size within easy image gallery. Replace the word "large" with your new size.

    function my_easy_image_gallery_large_size( $size ) {
        $size = 'large'; // change this to your new image size.
        return $size;
    }
    add_filter('linked_image_size','my_easy_image_gallery_large_size');
  5. meltdown2
    Member
    Posted 9 months ago #

    Hmmm... OK, I've attempted to initiate this but have not been successful. Here is the code I've added to functions:

    function themeic_thumb_sizes() {
    
    		if ( function_exists( 'add_image_size' ) ) {
    			add_image_size( 'fullscreen-slider', 1366, 2000, true );
    			add_image_size( 'themeic-slider', 1366, 2000, true );
    			add_image_size( 'nivo-slider', 800, 500, true );
    			add_image_size( 'themeic-full', 1170, 900, true );
    			add_image_size( 'themeic-large', 600, 450, true );
    			add_image_size( 'themeic-medium', 400, 400, true );
    			add_image_size( 'themeic-small', 300, 300, true );
    			add_image_size( 'themeic-services', 400, 230, true );
    			add_image_size( 'themeic-thumbnail', 100, 100, true );
    			add_image_size( 'blog-full', 1170, 750, true );
    			add_image_size( 'blog-large', 600, 250, true );
    			add_image_size( 'blog-medium', 400, 250, true );
    			add_image_size( 'blog-small', 300, 300, true );
    			add_image_size( 'blog-thumbnail', 150, 150, true );
    			add_image_size( 'mugshot', 240, 275, true );
    			add_image_size( 'icon', 50, 50, true );
    			add_image_size( 'easy-image', 780, 600, true );
    		}
    
    	}
    
    	add_action('after_setup_theme','themeic_thumb_sizes');
    
    	    add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' );
        function custom_image_sizes_choose( $sizes ) {
            $custom_sizes = array(
                'easy-image' => 'Easy Image'
            );
            return array_merge( $sizes, $custom_sizes );
        }  
    
    	function my_easy_image_gallery_large_size( $size ) {
        $size = 'easy-image'; // change this to your new image size.
        return $size;
    	}
    	add_filter('linked_image_size','my_easy_image_gallery_large_size');

    As you can see, I've added the "add_image_size( 'easy-image', 780, 600, true );" and am attempting to call it but on my Settings > Media page the 'Easy Image' option is not present.
    Obviously I'm missing something. Does this look as it should? Can you spot any obvious mistakes?

    Thanks again

  6. sumobi
    Member
    Plugin Author

    Posted 9 months ago #

    Wow that's a lot of image sizes you have there. You don't need the if ( function_exists( 'add_image_size' ) ). I see no code in your example for adding it to the settings -> media page.

    Now that you've got that code, have you tried uploading a new image to your gallery. Is the gallery still not opening your image at 780x600?

    Don't forget the image needs to be large enough to be successfully cropped at those dimensions.

  7. sumobi
    Member
    Plugin Author

    Posted 5 months ago #

    Closing due to customer inactivity

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.