If you use a filter like the following to adjust the order of a post type archive, then the next & previous links will work perfectly without need for modification:
function wpse_139866_set_order_by( $wp_query ) {
if ( ! is_admin() && $wp_query->is_post_type_archive( 'my_post_type' ) && $wp_query->is_main_query() ) {
$wp_query->set( 'orderby', 'title' );
}
}
add_action( 'pre_get_posts', 'wpse_139866_set_order_by' );
Related Posts:
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- Filter next_post_link() and previous_post_link() by meta_key?
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- How can I get next post id after current post id for custom post type
- Problem excluding category from get_next_post
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Using previous_post_link and next_post_link to wrap around post sequence
- Working with Next and Prev links in Single Taxonomy Templates
- next_post_link and previous_post_link in custom post type single page, in same non-custom category
- Next and Previous Posts of Same Parent
- Modify previous and next post links to current Authors Other posts
- Why are previous_post_link/next_post_link skipping some posts?
- Add Previous/Next Buttons to CPT Single Pages Only
- Custom Posts and Posts – next_post_link and previous_post_link not working together
- Display next 3 posts based on custom taxonomy
- Include “Scheduled” (“Future”) Posts in WordPress Post Navigation ( previous_post_link, next_post_link ) for a Specific Custom Post Type
- How to get next post link of child custom post type from parent post and get next post link of parent post from the last child post?
- Prev/Next Navigation on Single Post Disappeared for Custom Post Type
- Back, Next, and Previous links for the REFERRING term archive
- get_previous_post_link and get_next_post_link of custom post type that share custom field value
- Previous/Next custom post links within custom taxonomy
- Next/Previous Post Links in single-[custom-post-type].php file
- previous_posts_link returns null when querying custom post type
- Adding ‘menu order’ column to custom post type admin screen
- Custom post type – order field
- Displaying a custom post type alphabetically
- Order by & include array by specific post ids
- Sort Order for a Custom Query in a Post Type Archive Not Working
- Select All in Parent Category, Group by Child Category?
- Ordering posts having multiple post-meta date fields
- next and previous post link ordered alphabetically
- Order Posts by Taxonomy and Meta Value
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Custom Post type sort order not working in the admin area
- Order posts by (hierarchical custom) taxonomy terms and term children
- Compare 3 custom fields and sort by oldest
- List upcoming events, ordered by date in a custom field
- ascending order custom post type
- WP_Query post at custom position
- Sort custom post types by last name in the backend
- query order by date on custom type: wrong order
- Taxonomy list. Order by a specific custom post type count
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- WooCommerce – Show orders for a specific product ? [closed]
- Re-order posts in query after
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- Display custom post types with custom date field value (before today) & order by custom date field
- Custom Post Type order by modified date and custom meta field issue
- How to query different post types in specific order?
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Combining sorted and random CPT
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- I did group my search results by post type, but how can i give each of them its own order?
- Ordering posts in Search & taxonomy by post_meta
- Rewrite and custom post type: order by custom field not working
- How to set order for a custom post type
- Previous/Next Link by Meta Value in CPT
- How to order separated Custom Post Search results
- Wp_query: sort by PHP variable
- Allow user to set custom order to a list of custom taxonomies?
- Sort CPT archive by order prevents sorting in admin
- How to do WP_Query with two meta fields with orderby clause
- How to order and group custom post type posts by year and month
- Order Custom Post Type by Custom Field Value
- Get the taxonomy of a post hierarchically
- Change sort order when using ‘orderby’ => ‘type’
- Display Woocommerce Orders for specific author [closed]
- Ordering custom post type by multiple custom fields
- next_post_link and previous_post_link order not working properly
- next/previous links on custom post single a little screwy
- Manage Columns : order by post_parent’s title
- Order by custom field meta_key date and then by custom file meta_key number
- Archive not sorting correctly
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Ascending Order is not Working in Custom Post Type Listining
- Add a custom meta box for client to order CPT posts how they want
- Custom post type sorting: alphabetical order
- $wpdb->get_col and ORDER BY?
- How to use next_posts_link/previous_posts_link for custom post types paginate?
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- WP_Query of custom post type sorted by meta_key has unexpected results
- WP_Query not resetting after wp_reset_postdata
- Post ordering not working with custom field
- Filtered by a custom field, ordered by another
- orderby parameter not working in custom query
- Adding Page Ordering to a Custom Page Type
- Displaying Portfolio Filter by Category Order (alphabetically)
- show most viewed posts of last days by link?
- Changing WordPress sort order for returned child pages
- CPT : Next or Previous term link when has not adjacent post
- Order posts by taxonomy terms
- wp rest api orderby field in a custom table
- Display Parent-Child Posts in specific order by comparing IDs in array
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to order taxonomy terms by most recent post?
- Orderby if between two meta fields
- Display custom posts, ordered by most commented, without duplicates
- Custom post type order by post_title