If I understand it right your workflow is that you query posts (implicitly via normal WP mechanics), then display data from external database for them, but want to sort based on external data.
This isn’t trivial (without mirroring you don’t want to do), since WP relies primarily on SQL over its own data for sorting.
One of the ways you could implement it (assuming parity of entries data with external database) is to use that database for sorting:
- Query external database for entries with required sort.
- Get a set of ISBN entries.
- Query posts from WP database corresponding to entries.
- Override main query with this set of posts (
post__in
query argument andorderby=>post__in
for example).
Quite roundabout, but I can’t think of other way without data mirror.
Related Posts:
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- 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?
- How to order adjacent posts (prev / next) by custom field value?
- Sorting a query by custom field date
- Custom Taxonomy Template Post List with Sort Order
- Right way of storing large number of custom post fields
- Custom post type or just use custom fields
- 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
- Using posts and postmeta table to store custom Address Book Plugin data
- Sort by two dates. Default entry date and custom field if present
- WP All Import – Using Xpath to set a select value
- WP_Query order by custom field, then randomly order some of results
- Importing Data from a Non-WordPress database, into WP
- Specifying meta field’s column type in Database using add_post_meta
- Sort custom post type by most current date picker
- Make a custom column sortable by a value from a different custom post type
- Ideas to connect external database table to wordpress posts as custom field source
- delete duplicate meta_value with same post_id
- How can I sort the order of multiple custom field values in a custom post type?
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- when looping through custom post data not appearing
- custom post types, custom fields and normalization
- How to replicate data storage and querying using WordPress. Custom posts/fields or Custom db tables?
- Confused about where to store my data
- sorting in wp query based on custom field value
- Populate custom post type/custom fields from an external database
- Automatically convert standard posts with custom fields to custom post types
- How to enable the user to add value through the admin panel?
- Displaying database table in backend of wordpress
- Sort CPT by taxonomy AND THEN by custom field
- Advanced search form with filters for custom taxonomies and custom fields
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- Search multiple custom fields by using meta_query
- Custom Post Type – Taxonomy Dropdown Menu?
- How do I implement custom fields without using any plugins?
- How I check if the same post slug has not been used before publishing?
- order by meta_value serialized array
- Custom post metadata not appearing in public API
- Automatically Insert Custom Field on Custom Post Type Publish
- Create a post in custom post type using field in registration form after users submit form
- WordPress custom meta field for custom post not storing data
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- List all images from a single post meta value
- Combining sorted and random CPT
- Publish an XML feed from a CPT with ACF fields?
- WP_Query: include custom post type only with specific meta value
- How to set up multisite for multi language?
- Creating a Custom Post as a repository for theme constants
- Create a clone from one WordPress site to another in a few minutes
- Orderby CPT custom fields not working
- get_post_meta not working on publishing
- Query custom post type with ACF Date
- How to create a custom post type with additional fields?
- Add custom field in comments form
- Order Custom Post Type by Custom Field Value
- Hierarchical custom fields
- Fields for different parts of a page
- Facebook social publisher and custom post type fields [closed]
- Searching Custom Fields
- How to display custom field value on page?
- Should I use custom taxonomies or not?
- How to get specific post meta by title or id
- Populate a custom field dropdown with post titles by author
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Adding Template Post Content
- How to display a WordPress Custom Field only on a specific day of the week?
- Filtering custom posts by custom fields (ACF) [closed]
- Save Custom Fields
- Custom loop request based on custom field
- Writing a custom Glossary plugin
- Filter search posts by post meta?
- Display Posts that fit a certain criteria on Category pages
- Sort custom post column by generated value?
- How to only display all posts to a custom User Role?
- Custom post type and custom taxonomy key lenght & query performance
- Custom post type order by post_title
- register_rest_field update_callback don’t work for $_FILES
- How to convert Post Object Custom Field into Tags
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- PHP Notice: Unidentified index
- check_admin_referer not working in custom meta box for custom post type
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- I want to split this into two functions
- Repeatable Custom Field for Media Upload
- Most efficient way of deleting post
- Problem with menu categories doubling up when updating database?
- How to store datetime from custom meta box so that it can be sorted by
- Custom Post Meta on a Different Page?
- Switched server & domain name, now custom post types won’t save
- Adding a custom field after post title (ex.Example Title [30 Second Read])
- Creating post custom field text area
- querying to custom field over ACF REST API
- Send email on creation of custom post type and use get_post_meta()
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- WordPress does not show the custom fields box
- Query order by a numeric ACF field