• I am using the WP gallery as staff directory for one of my clients. The gallery is set to 4 columns but the last row only has 3 gallery items. My client liked the clean look of the grid but asked that I center the bottom row. I tried to talk them out of it but they won’t budge.

    Since Cleaner Gallery organizes each row into a div, I was able to target “.gallery-row:last-child” and add 15% padding to the left. It works well but I know if they add a staff member or someone leaves, I will be forced to go back in and tweak the css to correct it. What I tried was:

    .gallery-row:last-child {
    display:inline-block;
    margin:0 auto;
    }

    in the hopes that the row’s width would adjust to the width if its contents and then center but no go. Can anyone suggest a better way to go about this that will adjust to the correct position based on the number of gallery items in the last row?

    Here’s the link: https://rci-group.markhannondesign.com/our-staff/

    https://www.ads-software.com/plugins/cleaner-gallery/

  • The topic ‘Need help with a gallery hack’ is closed to new replies.