Posts_per_page depending on screen size
-
Hi,
I’ve got a custom archive page for a responsive theme I’m developing. I use a standard main loop to pull posts, so obviously it uses the settings in dashboard for its posts per page. However, I’d like to filter this based on screen size. Is this possible?
Using CSS and just hiding posts doesn’t work because if a visitor uses pagination, they will never be able to see those hidden posts. I’ve ran into trouble using pagination with a WP_Query loop and so creating a secondary loop doesn’t really work either. I’m starting to think this might just be impossible, since its kind of trying to alter pagination based on screen size. I’m a bit unexperienced, but maybe an AJAX call would work in this case?
Thanks in advance for any help.
- The topic ‘Posts_per_page depending on screen size’ is closed to new replies.