Change limit() for mobile?


I’ve been using a combination of limit() and offset() to create a slider that shows groups of 4 divs. on mobile this doesn’t look so great so I was hoping to change the limit to 1 in that case. Is there a way (through kirby, php, jquery, anything) to do this?


For php, you could use:

There are also JS/Jquery alternatives.

You could maybe also solve this with CSS and media queries:

@media (max-width: 600px) {
  .element:not(:first-child) {
    display: none;

Mobile Detect worked great. Thanks so much!