I think that the cookie is the best if not the only solution…
Cookie can be implemented by php or js and is your choiche to choose the right method:
Depending on:
-
the client needs (they have to work also if js is not present?),
-
the number of custom posts and site traffic (they can become a json file in a “special page” precompiled so the server can be lighter…)
PS: remember to study the right solution:
-
what if the post are less than 3?
-
what if they are not dividable by 3? (5 for example)
etc
Related Posts:
- How to get order of posts?
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Sorting: custom query with orderby meta_value_num THEN by title
- Order posts by ID in the given order
- How to order posts tag by tag?
- Loop through all tags & output posts in alphabetical list
- Woocommerce custom loop to show all the products [closed]
- Sort by meta key on archive page
- Show all parents and children in custom post type in right order
- Meta query with order by another custom field
- WP_Query Order by Specific Post ID First
- How do I sort posts with multiple pages
- Sort wordpress custom posts based on meta value
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- Understanding the orderby in WP_Query?
- Order by empty custom field
- How to order posts by title after they have already been sorted by category
- Help ordering Post loop by two meta values
- WP Query – order posts by meta field first and then order the rest
- How do I sort this custom list of sticky posts
- Filtering by multiple conditions in the loop
- WP_Query orderby random do not repeat infinite scroll – one loop
- orderby ignored by wp_query
- How to sort store location by specific category order in WP store locations
- How to sort wordpress posts already selected by WP_QUERY
- Order by value of Custom Field using url string
- WP Query with meta queries
- Order 2 meta_queries differently in WP_Query?
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- Sorting is not working in WordPress WP_Query
- Sorting: custom query with orderby meta_value_num THEN by title
- query_posts with sorting on a custom datestamp
- Order by multiple meta keys on wordpress
- the_post_thumbnail and multiple WP_Query
- I have 3 categories, i want to display on a loop the last 3 of every category
- Custom post type loop error: Trying to get property of non-object
- Order & Orderby clause not working with custom query
- Second WP_Query loop shows data from main query
- Meta Query if Values Don’t Exist
- Get post Number with local loop and template
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Why is my query not giving results?
- wp_query sorting – one specific meta_key value at last and then sort by create date
- Ignoring ‘a’ when sorting posts
- why default wordpress loop not working outside index.php
- how to show more than 1 post into three columns query
- WP_Query doesn’t works inside loop
- query_posts based on a meta_key
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Calling a function with WP_Query only ever brings the first result
- View related categories in order of posts
- modifying the loop multiple times with arguments passed through ajax to wp_query
- WP_Query causing links to not work
- Order posts by more than one variable (meta_key and publish date AND time)
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- Create custom order sortby based on array of id
- Wrap group of wp query posts to parent div by date/year
- Continue loop after $queryObject
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- display post multiple times based on array of dates
- Best way to Order Post in Home without a plugin
- Retrieving category pages from subcategory returns empty sets
- orderby in WP_QUERY – Use the order from the Dashboard
- How to make a wordpress loop file that displays posts based on certain conditions
- active link for most recent post on vertical tabs
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Pagination returns 404 after page 20
- Sort by meta key within same day
- Problems with WP_Query, Loop, a condition and Posts per Page
- Find by post_meta, then sort by post_meta, then sort by date (wp_posts)
- Query All Attachments and Order by Parent Publish Date
- Sorting posts by meta values: 2 different orders
- Ordering Posts by parent category, name ascending
- WP_Query secondary query failing
- custom query – offset to pagination
- WP_query for posts with same post type AND same post category
- Order Custom Field by Price
- How to solve this script problem in theme directory?
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query a custom field value bringing back 0 results
- Set Transient on CPT
- Issue in If else condition [closed]
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Pagination not working with WP_QUERY
- Using orderby with 2 meta keys
- Show posts in category
- Both WP_Query and get_posts returning 1 post
- Custom search (wp query by custom fields)
- Order posts by custom column using pre_get_posts
- Add filter to Orderby Parameter using Array
- Iterate through ID’s in loop
- Add custom WP_Query after the first 3 posts
- How to sort a WP_Query array by post_name after an array_merge();
- Load 3 posts in flexslider slide [closed]
- Loop through multiple custom fields with increasing number
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Different number of posts showing in development vs production server
- Issue with WP_Query (need a array of selected ID’s)
- Order WP_Query results in order other than ASC or DESC