You’re initially submitting a POST
request via a form with the sort parameters. When you click links to additional pages, you’re just sending a GET
request for the next page without those original POST
vars, so they don’t carry over to the additional pages and aren’t picked up by your if(isset($_REQUEST['sort']))
. Probably the simpler way to handle it is to pass the sort parameter as a query string appended to the URL, then check for that query string and append it to the URLs of the additional pages.
Related Posts:
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Sorting: custom query with orderby meta_value_num THEN by title
- How to get order of posts?
- Meta query with order by another custom field
- 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?
- Help ordering Post loop by two meta values
- orderby ignored by wp_query
- Customize the Sorting Dropdown in WooCommerce use another list or more page
- 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?
- Display three sequential posts on each page load, without repeating previous
- Sorting: custom query with orderby meta_value_num THEN by title
- query_posts with sorting on a custom datestamp
- WP_Query orderby date not working
- Order by optional meta key?
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- WP Query orderby meta key natural sort?
- How do I order pages and categories by ID or name in the same query?
- WP_Query ordered by custom field that is a date string?
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Merge 2 args in one WP_Query and order it by date
- Revolution Slider Orderby Two Custom Fields
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- WP-PageNavi gives me a 404 when using WP Query
- Customize the Sorting Dropdown in WooCommerce
- Woocommerce custom loop to show all the products [closed]
- How to use order RAND() on WordPress?
- WordPress WP_Query orderby being overwritten
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- Order WP_Query by multiple fields, subtracting them from one another
- pre_get_posts order by not working
- Orderby ASC changes to DESC in WP_Query
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- WP_Query order result by date AND meta_value
- Wp_query: sort by PHP variable
- Order by title without taking into account ‘the’
- WP_Query orderby author__in
- Weird orderby => post__in issue
- WP_query sorting can’t sort danish letters (æ, ø, å)
- How to order posts by title after they have already been sorted by category
- Advanced ordering of query_posts
- meta_value_num not ordering all items
- WP Group posts by year(desc) > month(desc) > date(asc)
- Does wp track views for posts?
- how to get post order by post id wp_query?
- Sort WordPress Posts Meta value by Week not Day
- Debugging wp_query orderby for taxonomy
- WP Query – order posts by meta field first and then order the rest
- How to order WP_Query to group results?
- Specify strict ‘order by’ in WordPress query
- Sort custom posts in archive by multiple values: date AND meta key
- Order is breaking wp_query
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- How to use a dropdown to filter posts by custom field
- How order posts from category by date and comment count?
- Orderby two meta fields not working
- WP_Query order by multiple meta keys & fields
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- Custom Woocommerce Product Query
- Custom order of posts in wp_query and different taxonomies
- WordPress Query custom ordering by temporary variable
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- WP_User_Query Orderby Not Working
- Query Order By Number Variable From API
- How to get_comments() ordered by date and parent?
- WP Query. Ordering posts by another post types meta
- Order & Orderby clause not working with custom query
- query_posts based on a meta_key
- Wrap group of wp query posts to parent div by date/year
- Best way to Order Post in Home without a plugin
- Sort by meta key within same day
- Query All Attachments and Order by Parent Publish Date
- Sorting posts by meta values: 2 different orders
- Order posts by custom column using pre_get_posts
- Add filter to Orderby Parameter using Array
- Order WP_Query results in order other than ASC or DESC
- Show sticky post before other WP_Query
- Custom query to order by multiple taxonomies
- Get post closest to today
- orderby in WP_query doesn’t works
- Order by meta values
- orderby and order filter in get_posts or WP_query function in wordpress not working
- Why does wp_query only display the most recent post when using order ASC?
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- WP_Query sort by ACF date field (newest first) with blank dates first
- Sort by multiple columns using get_posts
- new WP_Query with order args – no more distinction between categories