• Resolved Lee

    (@junior)


    I ran across this post the other day and I am interested in doing this for gallery images on my blog but when applying the code found on the page linked above:

    @media all and (max-width:760px){
      .wp-block-gallery .wp-block-image {
        width:100% !important;
      }
    }

    all of my galleries are also stacked. Is there a way to apply it only to a certain page, in my case, my blog only?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator jordesign

    (@jordesign)

    Hey @junior – that kind of thing will be possible, yes. Do you have a link to the page you’re trying it on so I can see specifically and work out what CSS is needed?

    Thread Starter Lee

    (@junior)

    Here’s the website. Thank you.

    Moderator jordesign

    (@jordesign)

    Fantastic – thanks @junior.

    Could you please try this CSS instead?

    @media all and (max-width:760px){
      .blog .wp-block-gallery .wp-block-image {
        width:100% !important;
      }
    }
    Thread Starter Lee

    (@junior)

    That worked perfectly. Thank you very much!

    Thread Starter Lee

    (@junior)

    Hey @jordesign, any idea why this would suddenly stop working? I use a child theme and have custom css applied and working but for some reason this specific one no longer works.

    Moderator jordesign

    (@jordesign)

    Hey @junior – just double checking was it on this pages you wanted the images to be full width and stacked? Or on the individual posts?

    https://leecosta.com/blog/

    Thread Starter Lee

    (@junior)

    @jordesign Please disregard my previous comment. I recently changed a few things around and noticed that it doesn’t work because I was hoping for the code to be applied to my single pages instead of the blog. All I had to do is change the part of the code from .blog to .single.

    All is well. As always, thank you for the amazing support.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Stacking gallery images on certain pages only?’ is closed to new replies.