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
- Sort custom posts by date and then by taxonomy
- Query custom post type that has a serialized relational advanced custom field value
- How To Read Read Custom Post Type Data in Headless CMS Mode
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- Using OR relation in meta_query to check for a value before sorting by another
- How to upload an image to a custom post type
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Updating a custom post status after an expiry date rather than trashing it
- WP_Query get always custom post_type for first
- Does this archive template part look like its making too many calls to the db?
- Custom post type sortable columns when column value is from a custom database value
- Display Posts that fit a certain criteria on Category pages
- How to display custom field in product description?
- Sort custom post column by generated value?
- Right way to store a large set of similar information on website? [duplicate]
- Custom Column in CPT admin table not updated after Quick Edit save
- How to only display all posts to a custom User Role?
- Why this didn’t work if i use get_the_ID(), but works if i pass the numeric id
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to keep custom post type related information
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- How to avoid duplicate posts queried from custom meta?
- Custom Metabox Info Not Saving
- Add custom template ‘sub-page’ to Custom Post type?
- How can I query and sort custom-post type using WP_Query
- Meta query and compare “!=” not working as expected
- Custom post type and custom taxonomy key lenght & query performance
- Display Custom Field or Custom Taxonomy in front page /post/product
- How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?
- Orderby if between two meta fields
- How to add dynamic fields on wordpress custom post type page in admin section
- Sort custom post type by custom datepicker instead of filtering
- How select query is generated in a Custom Post Type?
- How to access repeater field of a custom field?
- Filter posts by their related field’s custom field
- Post Click Redirect to Custom URL instead of Single Post Page
- How to sort by multiple values in a nested WP_Query
- wp_insert_post deleting previous post custom meta
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Custom post type order by post_title
- Problem in moving cpt’s from local website to live website
- How to sort post category using its Description
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- register_rest_field update_callback don’t work for $_FILES
- Query custom post type and custom field by URL parameters
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Where is get_post_meta value located?
- How to convert Post Object Custom Field into Tags
- How do I query with multiple custom fields orderby in same column?
- dynamic vue widget inside custom post
- PHP Warning with Custom Fields
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- I want to create a metabox under custom taxonomy
- meta query multiple values for the same key
- Problem with multi checkboxes value in metabox?
- How can I register multiple custom post fields to json?
- Sort custom post archives by a meta value from a different custom post type?
- filter using custom fields
- Create 3 Levels of relations with WordPress
- Exporting Post type from one theme and importing it to another theme
- Show Post columns to specific users on condition
- Displaying Custom Fields from Custom Post Types [closed]
- Displaying posts inside table having issues