You can filter SQL to change to your condition in get_adjacent_post()
( source ) :
$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" );
Or filter link altogether in adjacent_post_link()
( source ) :
echo apply_filters( "{$adjacent}_post_link", $format, $link );
PS $adjacent
can be next
or previous
.
Related Posts:
- How do I set the default admin sort order for a custom post type to a custom column?
- Using meta_query, how can i filter by a custom field and order by another one?
- Sorting a query by custom field date
- Custom Taxonomy Template Post List with Sort Order
- How to sort a table of custom posts by column containing custom field
- How to Sort Custom Field Admin Column by Date
- How to Sort by Date When Using d-m-Y Format
- Sort by two dates. Default entry date and custom field if present
- Custom Post Type Navigation on Custom Field
- Sorting custom post type columns with external data and without meta values
- WP_Query order by custom field, then randomly order some of results
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Sort custom post type by most current date picker
- Make a custom column sortable by a value from a different custom post type
- How can I sort the order of multiple custom field values in a custom post type?
- sorting in wp query based on custom field value
- Sort CPT by taxonomy AND THEN by custom field
- How can I change the admin search posts fields?
- Development of a WordPress Search Plugin – Best Practices
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- WordPress 4.4+ : How to revision CPT + metadata
- Filtering a WP_Query meta_query by numeric values isn’t working
- Filter admin columns by custom post field value
- Querying custom post type with 2 custom fields (date-range)
- manage posts custom column is not populating data from meta boxes
- Create child page within custom post type
- Add custom field to media attachment image attribute in post editor
- Getting Bootstrap accordion working in WordPress loop with custom post type (collapsing issue)
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- set and unset the custom field value
- How to programatically set the post title of a CPT on wp-admin
- WP insert post PHP function dynamically generated Custom Fields
- How to add custom fields to admin UI and REST API response?
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Select menu should display categories and the item’s depth
- Before Delete Post
- Display custom post on home page based on a metabox selection
- current-menu-item not working with custom post type
- Sort posts based on multiple custom fields
- 1 day after custom date change post status to draft
- WP_Query that filters based on custom relationship field
- query_posts with a custom post type, a meta_query and sorting by post date?
- sort order for a custom post-type [closed]
- Filtering by Post Meta Custom Fields – Performance
- Why do I lose the content of meta boxes when I leave the page?
- Remove wrong dashes from get_the_title()
- Populate Custom Fields in a Custom Post Type?
- How to change post featured image using a custom field of category?
- Returning a list of custom post types excluding those without a specific meta_value
- Paging doesn’t work?
- Custom post type content using custom fields without template
- Hide post navigation if current post is in a category with only one post
- Plugin – Combine Meta Box Input Fields into single saveble record
- How to render a custom post type template with custom fields using shortcode
- Get Posts by multiple custom fields is not working
- Sort entries by date mixing two post types
- Cannot save CPT meta box
- Order a custom post type admin screen by a second custom post type title
- Enable Custom Fields For Custom Post Type When CPT Created Using Plugin
- post_per_page ignored in WP_Query
- Displaying Custom Posts
- Display custom post type for specific user
- Display custom meta on page that has been check in custom post type
- How do I update_post_meta() or add_post_meta() with an AJAX call
- How to prevent meta data from being edited in a post?
- Automatically add a character to field in edit post page
- Change Post Meta via AJAX from the posts list table
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Saving metabox keys and storing values as array
- Mandatory field in Custom post
- How to store the third party script with HTML code in the wordpress custom input field?
- WP Query from two Custom Post type fields as statement
- How To Read Read Custom Post Type Data in Headless CMS Mode
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- How to display custom field in product description?
- when looping through custom post data not appearing
- Add custom template ‘sub-page’ to Custom Post type?
- How to sort by multiple values in a nested WP_Query
- How to create a Child & Siblings menu for a custom post type?
- Adding a Section for Visitors
- Automatic Set Category For A Custom Post Type
- Custom nav menu current item custom link problem
- Generate slug and meta data if meta field is empty
- one get_posts to return a number of custom posts for each meta value
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Get result from Custom Field in Custom Post type
- Advanced search form with filters for custom taxonomies and custom fields
- Querying meta values within an array
- Creating entries with image attachements within posts and managing them in a list
- How to Create a Frontend Html-list Editable in the Backend?
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- current_page_item and custom post type?
- How to get lowest price from custom fields of posts
- Send email on creation of custom post type and use get_post_meta()
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Post object GUID adding http:/
- WordPress does not show the custom fields box
- Query order by a numeric ACF field