Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Feedback
  3. Thumbnail Image aspect Ratio

Thumbnail Image aspect Ratio

Scheduled Pinned Locked Moved Feedback
6 Posts 5 Posters 190 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    ml
    wrote on last edited by
    #1

    Hi there,

    Having done multiple websites with Laytheme, a thing I always stumble upon is that the thumbail grid is not automatically cropping images to a certain aspect ration.
    That means, if you want to have a clean thumbnail grid, you need to upload for each image an extra cropped thumbnail version.
    Would be pretty dope if you could set an aspect ration for thumbnails in the settings!

    Thank and have great day,
    Marius

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @ml
      This is a great idea and we will write it down for the future. Right now this is not possible.
      Thank you!
      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Remco van Dun
        wrote on last edited by
        #3

        Would love this, very useful :)

        1 Reply Last reply
        1
        • S Offline
          S Offline
          spontans
          wrote on last edited by
          #4

          would be very helpful and freeing of cropping the images manually

          1 Reply Last reply
          0
          • arminunruhA Offline
            arminunruhA Offline
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            Enter this css in "lay options" -> "custom css & html" -> "custom css":

            .thumb-collection .ph{
            padding-bottom: 100%!important;
            }
            
            .thumb-collection .ph img,
            .thumb-collection .ph video{
            width: 100%!important;
            height: 100%!important;
            object-fit: cover!important;
            object-position: center!important;
            }
            

            this way you will have a thumbnailgrid of just squares.
            change the padding-bottom to change the aspect ratio.

            to have a 16/9 aspect, you would calculate:

            9 / 16 * 100 = 56,25

            would be:
            padding-bottom: 56,25%!important;

            and u may want to read this
            https://developer.mozilla.org/en-US/docs/Web/CSS/object-position

            about the object position css

            1 Reply Last reply
            0
            • S Offline
              S Offline
              spontans
              wrote on last edited by spontans
              #6

              Thanks Armin,
              Worked like a charm, would be very useful if there would a way in the future to control it via the Thumb\Element grid visual interface...

              I've also implemented it for Element Grid:

              .elements-collection-region .ph{
              padding-bottom: 100%!important;
              }

              .elements-collection-region .element-wrap img,
              .elements-collection-region .element-wrap video{
              width: 100% !important;
              height: 100% !important;
              object-fit: cover !important;
              object-position: center !important;
              }

              1 Reply Last reply
              1
              • R robsdonatini referenced this topic on
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              I also code custom websites or custom Lay features.
              šŸ’æ Email me here: šŸ’æ
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search