Hi, I am trying to make a secondary page with the rest of the announcements. The problem is that the list of announcements starts again from the first one.
I’ve seen a few topics on this before but no replies
I tested several codes without success, here is the last one and theoretically the most optimized.:
add_action('pre_get_posts', function ($query) {
if (!is_admin() && $query->is_main_query()) {
if (is_page('page-2')) {
$query->set('offset', 16);
}
}
});
I don’t see what pagination you are talking about, I may have passed by without seeing it, I only see the one for each ad category.
My goal is to make a continuation of the main page which presents the announcements only sorted by date and not by category.
But if I put the ad block sort by date back on a second page I end up with the ads seen on the first page.
If I understood you correctly, you have listings sorted by category in the first block on the listings page, and the other block should display listings sorted by date?
Hello again, sorry I must express myself badly, I have on the main page like everyone else a list of ads by date I would like to make a secondary page which would simply follow this list without repeating the first ads (always sort by date).
For a better understanding I left the problem active on my site between here and here.
You can delete this message after reading
You can then edit this page in the WordPress Dashboard > Pages, select this listings block, and on the right sidebar, specify sort by date: Awesome Screenshot
Unfortunately, I don’t quite understand what you mean. You currently have one block of listings on the homepage, and another block of listings on page number two. If you want to remove the block on the first page, then just edit the home page in WP Pages > Home Page.
That’s exactly the problem.
I don’t know what you mean by normal pagination?
I just found what you mean if I deactivate the categories page then I effectively have an endless list of announcements but if I want to keep this page ?
the way I see it, you should display only a subset (latest listings) on the HP, and maybe a provide a link right below this block leading to all listings.