[Support request] Restrict number of posts on mobile

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Restrict number of posts on mobile

This topic contains 3 replies, has 3 voices, and was last updated by  Jeroen 3 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4444

    Jeroen
    Participant

    Hi,

    Is there an easy way to change the number of posts for different screen sizes?

    For example: on desktop the WPSP-list shows 10 posts and on mobile you see 3 posts.

    Jeroen

    #4463

    Tom
    Keymaster

    Hmm, I can’t think of a good way to do that unfortunately, unless you had some sort of script that could detect if you were using mobile or not on the server side of things.

    #6897

    Clayton
    Participant

    Kind of a work around but you can use nth child CSS selectors.

    .home-posts article:nth-last-of-type(-n+2) {
    display: none !important;
    }

    Wrap the shortcode in a div and give it the class of your choice. The CSS above with will hide the last two elements (posts) within that div. Then just use CSS3 media query to apply this css based on screen width. This is a great media query generator: http://giona.net/tools/css3-mediaquery-generator/

    I’m using this to change the number of posts being displayed on mobile and it works like a charm other than they are just hidden with display: none; via CSS.

    #6907

    Jeroen
    Participant

    Thanks for sharing. Will give it a try.

    J

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.