- This topic has 8 replies, 2 voices, and was last updated 3 years, 5 months ago by Paul.
-
AuthorPosts
-
October 30, 2020 at 9:47 am #1511387Paul
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
October 30, 2020 at 5:21 pm #1511748DavidStaffCustomer SupportHi 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.
October 31, 2020 at 1:04 am #1511936PaulHi 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
October 31, 2020 at 4:48 am #1512098DavidStaffCustomer SupportAah … 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.
October 31, 2020 at 2:44 pm #1512858PaulCheers David, I think I’ll go for the second option!
Thanks again for your help ๐
November 1, 2020 at 4:20 am #1513215DavidStaffCustomer SupportYou’re welcome
November 3, 2020 at 5:05 am #1515902PaulHi 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
November 3, 2020 at 7:57 am #1516350DavidStaffCustomer SupportYou would need the Pro version of the WP Show Posts plugin to do that:
Heres an example fo the Carousel:
November 16, 2020 at 7:08 am #1533544PaulThanks for your help David, it’s much appreciated.
Paul
-
AuthorPosts
- You must be logged in to reply to this topic.