The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Back End › Manage Number of Queries Based off Device
Ok, here’s a what if: you’ve got a homepage, and you want to put some news posts on it. You need:
It wouldn’t make sense to get all 8 articles and only use 2 of them for handheld devices. That could be a lot of extra queries and rendering time, even if you hide the unneeded parts with CSS.
So, for the sake of speed and efficiency, how would you change the number of posts you need based off the device that is being used?
Most straightforward way would be to get all of the posts via ajax, after the page has loaded and you can query the device.