[Support request] Order of show posts

Home Forums Support Order of show posts

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1511387
    Paul

    Hi!

    I’m currently running Dispatch theme and having a little trouble with the show posts. As it stands, I have some blog posts showing multiple times on my home page.

    At the top of the page, it shows the most recent 4 posts – which is perfect.

    But I’d like the next set of show posts to show the 4 previous to the top ones, and then the next set of show posts to show the previous 4 before that.

    So what I’m trying to achieve is each post showing only once on my homepage rather than being repeated multiple times.

    Does anyone know the best way to achieve this?

    Thanks in regards,

    Paul

    #1511748
    David
    Staff
    Customer Support

    Hi there,

    each of the Post lists on the Home Page of Dispatch are set in WP Show Posts. You can use the Offset field in the post list More Settings to shift their start position.

    #1511936
    Paul

    Hi David,

    Thanks so much for your help πŸ™‚ I’ve had a play with all of the offsets which work perfectly – apart from where I need it to!

    Link to the site: https://www.motorcycletourer.com/

    As you can see, the header contains the 4 most recent posts – which is what I want. Underneath the header kicks off the descending sequence of posts – which is also what I want. But it is this section on which I want the 4-post offset (so everything is in decending date order from the top down, and each post is shown only once.)

    I’ve tried altering offsets on 6 show post sections and nothing seems to effect those top 2 posts.

    Thanks again for your help!

    Paul

    #1512098
    David
    Staff
    Customer Support

    Aah … thats the blog archive which can be Offset as well, but it is a complete pain when it comes to pagination and load more content. I did find this snippet which may work:

    function myprefix_adjust_offset_pagination($found_posts, $query) {
        if ( $query->is_home() && $query->is_main_query() ) {
            return $found_posts - 4;
        }
        return $found_posts;
    }
    add_filter('found_posts', 'myprefix_adjust_offset_pagination', 1, 2 );

    https://docs.generatepress.com/article/adding-php/

    If not then the main method we suggest is to have the Hero grid display a set category/tag of posts eg. Featured. Then we can exclude that term from the main archive.

    #1512858
    Paul

    Cheers David, I think I’ll go for the second option!

    Thanks again for your help πŸ™‚

    #1513215
    David
    Staff
    Customer Support
    #1515902
    Paul

    Hi David,

    As another work around to this issue, is it possible to change the header show posts (currently set to 4) to just one image in a carousel format?

    Thanks again,

    Paul

    #1516350
    David
    Staff
    Customer Support

    You would need the Pro version of the WP Show Posts plugin to do that:

    https://wpshowposts.com

    Heres an example fo the Carousel:

    https://demos.wpshowposts.com/carousel/

    #1533544
    Paul

    Thanks for your help David, it’s much appreciated.

    Paul

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.