Gallery Thumbnails won't crop square to to Thumbnail size

Home Forums Spacious Free Gallery Thumbnails won't crop square to to Thumbnail size

This topic contains 17 replies, has 4 voices, and was last updated by  ashishsthanp 4 hours, 59 minutes ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1276915

    melinda
    Participant

    I am using this theme for a project and I can’t get the thumbnails to crop to the “Thumbnail” size or to crop square. I have looked in the functions.php file and found that it is setting the default size to Medium. I tried commenting that out but it makes the gallery thumbnails the Medium size and doesn’t crop them square as I want.

    How do I fix this?

    Thanks!

    #1276916

    melinda
    Participant

    i finally got it to work commenting out that part of code in the functions file. I would really like to somehow turn this off in the child theme I created so that if the theme updates I don’t lose my changes.

    How do I do this?

    Thanks!

    #1277309

    sajantg
    Moderator

    Hello @melinda,

    Please describe which image size you commented in the functions.php file so we could help you to do in child theme.

    Thanks.
    Themegrill.

    #1277436

    melinda
    Participant

    I would like the child theme to allow me to set the default gallery image size to THumbnail size instead of medium. The code I commented out is:

    /**
    * Removing the default style of wordpress gallery
    */
    add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

    /**
    * Filtering the size to be medium from thumbnail to be used in WordPress gallery as a default size
    */
    function spacious_gallery_atts( $out, $pairs, $atts ) {
    $atts = shortcode_atts( array(
    ‘size’ => ‘medium’,
    ), $atts );

    $out[‘size’] = $atts[‘size’];

    return $out;

    }
    add_filter( ‘shortcode_atts_gallery’, ‘spacious_gallery_atts’, 10, 3 );

    I would like to remove the comments and put code into my child theme functions file to turn this off.

    Thanks!

    #1277562

    sajantg
    Moderator

    Hello @melinda,

    You can do this on you child theme.

    add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

    AND

    add_filter( 'shortcode_atts_gallery', 'spacious_gallery_atts', 10, 3 ); TO remove_filter( 'shortcode_atts_gallery', 'spacious_gallery_atts', 12, 3 );

    Thanks.

    Themegrill Support Team.

    #1277773

    melinda
    Participant

    I added both

    add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

    and

    remove_filter( ‘shortcode_atts_gallery’, ‘spacious_gallery_atts’, 12, 3 );

    to the functions.php for my child theme but it isn’t working.

    What am I doing wrong?

    Thanks!

    #1277837

    sajantg
    Moderator

    Hello @melinda,

    Please remove this add_filter( 'use_default_gallery_style', '__return_false' );

    You can take reference from here.

    Thumbail Gallery problem

    Thanks.
    Themegrill.

    #1277965

    melinda
    Participant

    I tried that and also what was in the other tech support post. It is making the the thumbnails the thumb size now but not cropping them square. It is cropping proportional even though the setting is checked to make it a hard crop.

    Any ideas?

    Thanks!

    #1278088

    sajantg
    Moderator

    Hello @melinda,

    Please check the thumbnails size in setting. You can use the Regenerate thumbnails plugin too.

    Thanks.

    Themegrill.

    #1279205

    melinda
    Participant

    That worked!

    I had tried the regenerate thumbnails earlier but it didn’t work.

    Anyways thanks!

    #1323968

    goddess_shiva20
    Participant

    I have the same problem in my Spacious Free theme, but all the code Melinda mentions are not in the functions file anymore. So all offered solutions are not working either….

    I am in version: Version: 1.4.7

    I do not have a child theme at this time because I’m still learning WP 🙁
    In my back end i see nice square thumbnails, in my online page they are ‘normal’ shaped.

    #1324281

    ashishsthanp
    Moderator

    @goddess_shiva20

    Can you explain your issue again and provide your site URL if possible?

    Thanks.

    #1324949

    goddess_shiva20
    Participant

    I am using Spacious for: http://www.achtmaalserallyclub.nl
    I have many gallerys. http://www.achtmaalserallyclub.nl/archieven/fotos/bloemencorso-zundert-2017/

    In my back end i choose Thumbnail. Press add gallery and see nice square tumbnails in my backend. But then online i see landscape and portrets, not squares!

    Like i said, i’m still pretty new to Wp and don;t have a childtheme yet.

    #1325257

    ashishsthanp
    Moderator

    @goddess_shiva20
    Glad to know that you’re learning WordPress. Can you try creating a child theme following instruction in https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/ .

    And then, we can instruct you to create gallery as you want to be square on front end also.

    If you’re feeling hard doing so, you can contact our customization team for help.
    https://themegrill.com/customization/

    Regards,
    ThemeGrill Support Team.

    #1325292

    goddess_shiva20
    Participant

    Oh wow, that link was amazing! I hardly had to do anything myself. Except re-customize my homepage and some settings 😀

    Oke, i have a childtheme 😀 All works except the site logo.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.