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
- Woocommerce custom field search in custom post type [closed]
- Add custom field in comments form
- Custom Fields for Custom Post [closed]
- Order Custom Post Type by Custom Field Value
- Sort and filter custom post type posts by custom taxonomy
- Filter custom post types by a field value
- Displaying All Posts of a Custom Post Type in WordPress Multisite Backend
- How To Show All Custom Post Types In A Category Instead Of Pagination?
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to use TinyMCE Editor for one of my custom post meta field?
- Custom REST endpoints for a custom post type with custom fields
- WordPress posts page for customer filtering and sorting along with category filter
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- Hierarchy and access control for Custom Post Types (CPT)
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- manage_edit-{post_type}_sortable_columns sorts, but wrong!
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Sort entries by date mixing two post types
- First custom field value (out of several) displayed twice after query
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Meta Query posts not showing on ending date of custom field
- Cannot save CPT meta box
- Cross reference custom post types
- Adding Page Templates to post but it ignored it
- Order a custom post type admin screen by a second custom post type title
- Include related custom fields from one post type in another post type’s JSON feed
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- frontend image post uploader
- Is there any way to add a “custom field” to the CPT archive page?
- How to Output which matched meta_keys were found from custom_type_posts?
- Multiple Frontend Filters Using Advanced Custom Fields
- Custom Post Fields at the beginning of a Custom Permalink
- Integrate Custom Post Type Events into Calendar
- Possible to filter custom post type with multiple meta data?
- Hierarchical custom fields
- How to get a custom field value of a custom post?
- Fields for different parts of a page
- Is it possible to activate customfield ‘text description’ upon activating the customfield ‘checkbox’?
- Facebook social publisher and custom post type fields [closed]
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Displaying custom field according to date
- Displaying and searching Custom Posts
- Importing Data from a Non-WordPress database, into WP
- custom comments form for custom post type
- Searching Custom Fields
- Losing Nav Active State in Menu
- Show fields based on taxonomy selection in editor
- filter search custom field query
- Permalinks: custom structure for taxonomy – tags?
- How to let users choose where to search for posts?
- don’t publish custom post type post if a meta data field isn’t valid
- WebP Fallback for Inline Background Image in Style Attribute
- Query based on custom fields start and end date
- How to add multiple markers on the google map, at a certain meta_key and meta_value
- Custom Post Types in the WordPress Navigation Menu
- Custom fields for custom post type
- How can meta boxes be added to “unknown” custom posts?
- How to sort posts in a custom post type by title in ascending order by default?
- Custom “radio button meta box” not saving correctly
- It’s possible to hide body copy box for a custom post type?
- Can we create a custom post template for a specific page template
- Warning: Invalid argument supplied for foreach() [closed]
- Settings API – save multiple tabs at once
- Add additional field to custom post_type
- How to Get the title of a custom field?
- Custom Post Meta from custom metaboxes is randomly being deleted
- Check if post with same meta value exists
- DIsplaying URL of custom field in last post of certain taxonomy && post type
- Multiple single templates?
- Custom Field values not Showing in Edit Page of Custom Post Type
- sort post types by amount of views
- How can I add a custom field to an existing custom post type?
- Add a custom meta box for client to order CPT posts how they want
- Custom posts type for individual pages?
- Custom post type’s extra fields – how to handle?
- custom post data – how to
- Send a conditional email notification when a custom field value changes in Post Type
- Enable Custom Fields For Custom Post Type When CPT Created Using Plugin
- Create custom post with meta field with AJAX and the WordPress REST API
- Specifying meta field’s column type in Database using add_post_meta
- Custom post type sorting: alphabetical order
- How to get a custom type post data when it has a connection with another custom type post?
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?