I am working on a project that requires some advanced ordering of posts and advanced pagination.
Basically, we have posts in a category, lets call this category 'mycategory'. We then have post priorities (standard, sub and main) (these priorities are stored as a custom post field value). Each page is paginated to show a total of 20 posts.
When a category page is displayed, the first page will display the following:
- All posts are from the 'mycategory' category.
- 1 post from the main priority is displayed at the top. (The latest one.)
- 2 posts from the sub priority are displayed just below. (The 2 latest ones.)
- The rest of the posts shown (17 posts) are a mix of standard posts, and any posts that are marked as a higher priority (main or sub) that have not been displayed above. In date order. Latest First.
So the first page should display the latest main, the 2 latest sub, and then any combination of main, sub, and standard that have not already been shown in the 3 above, in date order.
When the 2nd page is displayed, it works differently:
- All posts are from the 'mycategory' category. as above
- All other posts displayed are a combination of main, sub and standard that have not been displayed on the first page. Also in date order. Latest first.
- The slots for the single main, and 2 sub, will be replaced with the other posts.
So the 2nd (and 3rd, and so on.) pages will display 20 posts (combination of standard, sub and main) in date order, that have not been shown on any previous page. This means that on page 2, if a post with a priority of sub is not displayed on the home page, it could display on the 2nd page (or where ever, based on date.) in a main slot, standard slot or in a sub slot.
I'm not too sure on how to get this to work in WordPress. Does anyone have any ideas at all?
Let me know if any more information is required.