Ok so after posting the question an option to view another similar question appeared. So here is the answer if somebody is trying to do the same thing.
//Using WordPress Pre-Get filter to order the custom taxonomy by custom field
function customize_customtaxonomy_archive_display ( $query ) {
if (($query->is_main_query()) && (is_tax('custom-taxonomy')))
$query->set( 'post_type', 'your-post-type' );
$query->set( 'posts_per_page', '-1' );
$query->set( 'meta_key', 'your-custom-field' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'ASC' );
}
add_action( 'pre_get_posts', 'customize_customtaxonomy_archive_display' );
Add this to your functions.php file, or create a plugin for it. Replace “custom-taxonomy”, “your-post-type” and “your-custom-field” with your details and you should get the results you are after.
Dan
Related Posts:
- Advanced search form with filters for custom taxonomies and custom fields
- How to Add Custom Fields to a Custom Post Type?
- What should I use – Taxonomies, custom fields, Post Type?
- clients list using wordpress
- Custom Taxonomy Template Post List with Sort Order
- Creating Photo Gallery System with Custom Post Type
- How to do a custom bookmarks post type?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- How to select one major category (or custom taxonomy) for a custom post type?
- Automatically assign a custom post to a custom taxonomy based on custom field value
- front end radio custom taxonomy with custom post type
- Is there any performance consideration when using Custom Post Types?
- Custom post type / custom fields
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- How loop through posts based on custom fields
- How to add custom fields to admin UI and REST API response?
- Get Custom Field Values by Another Custom Field in WordPress
- Custom Posts Hierarchy? (State/City/Restaurant)
- Automatically populate a hierarchical taxonomy from a custom field
- wp_query to find posts by year and month
- How to bulk copy custom fields between custom posts?
- Retrieve value of a category’s custom field
- wp_query check if integer exists in custom field’s array
- search also in taxonomy, tags and custom fields
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Show custom post type relationships by taxonomy
- Dynamic dropdown select values depending on other custom field value
- Hierarchy and access control for Custom Post Types (CPT)
- First custom field value (out of several) displayed twice after query
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Show fields based on taxonomy selection in editor
- Permalinks: custom structure for taxonomy – tags?
- Custom post type’s extra fields – how to handle?
- Creating custom post type with custom taxonomy and custom fields programatically
- Targeting categories in custom fields
- Custom taxonomies to define versions of a product
- Custom Taxonomy Search result page
- How to get_term_meta on single custom post?
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Many to many to many custom post relationships
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- How to fetch custom post types with its full data on wordpress?
- Reusable metabox backend and frontend
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Get custom term meta problem on single post type
- Custom post type name and assigning custom taxonomy
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Building a Portfolio and need some direction
- Custom post types category
- Custom Taxonomy dont save in a frontend form for post a custom post
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Should i use custom post type for a custom footer?
- Order custom posts by taxonomy, then by meta_key
- Confusion about how to use Custom Post Types, Custom Taxonomy or Category?
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Writing a custom Glossary plugin
- How do I ensure that post_type and Taxonomy use the same slug?
- add_filter get array data before display in custom post_type
- Custom taxonomy terms as children of multiple custom post types
- ACF – Retrieve custom taxonomy from a relationship field
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Display Posts that fit a certain criteria on Category pages
- Display Custom Field or Custom Taxonomy in front page /post/product
- wp_insert_post deleting previous post custom meta
- PHP Warning with Custom Fields
- I want to create a metabox under custom taxonomy
- Adding a Section for Visitors
- Query posts by multiple custom fields
- Custom taxonomy template for custom fields loop [closed]
- Create Inclusions and exclusions
- What’s the most efficient way to get two queries based on an if statement?
- Need some suggestion/help with custom post types project
- Best way to use Category & Custom Fields?
- predefined custom field on registration page
- Show Custom Post Type taxonomy term that matches custom field
- custom taxonomies are not showing up in get_taxonomies
- Storing/querying custom date data
- Order by custom field attribute
- Advanced search form with filters for custom taxonomies and custom fields
- Custom post type and custom taxonomy archive inaccessible
- Custom Post type as Taxonomy
- How to change order of custom post types. I want Featured post to come first
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes
- Custom Sort Order for Custom Post Type Taxonomy
- How to display recent posts added in custom post types
- Display custom post types with custom date field value (before today) & order by custom date field
- How can I filter by taxonomy on a custom post type’s page?
- How to Duplicate (multiple meta box)?
- Is $object_type truly required with register_taxonomy()?
- Query & Order posts by custom fields
- Suggested Post and Taxonomy structure
- Use custom walker to add taxonomy terms to main nav menu
- frontend image post uploader
- Displaying information from custom field on custom post type
- Display custom post types in dropdown with option “all”
- Back, Next, and Previous links for the REFERRING term archive
- Get category list & taxonomy list from different post type using post id?
- Make term slugs of custom taxonomy available in WP REST API for custom post type?