You can do this with the pre_get_posts
action. pre_get_posts
fires after the query variable object is created, but before the actual query is run. So you won’t suffer performance penalties by running multiple unnecessary queries.
In your functions.php
:
add_action('pre_get_posts','xx_taxnomy_query');
function xx_taxnomy_query($query) {
if ($query->is_main_query() && ! is_admin() && $query->is_tax('your_taxonomy')) {
$query->set('order', 'asc');
return;
}
}
Related Posts:
- Custom taxonomy terms not showing as list Gutenberg Editor
- How to only list the child terms of a taxonomy and not their parents?
- How to use taxonomies on attachments with the new Media Library?
- Hierarchical taxonomy UI
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- How to display custom taxonomies in posts?
- Filtering custom taxonomies
- Allowing specific users to only add posts using certain custom taxomy terms
- Edit tags page for hierarchical taxonomy doesn’t show taxonomies at all depths
- I want to load post content by categories using Ajax
- Hook to process a new taxonomy tag before it is created?
- Removing taxonomy base using WP rewrite
- get_terms() returns an empty array
- Scheduling posts to update once per day with wp_cron
- How to find taxonomy name using only taxonomy TERM ID (or taxonomy term name)
- Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
- How to assign default taxonomy to pages on ‘save_post’?
- WP_insert_term how to insert multiple values as taxonomny term?
- How to include parent terms in hierarchical taxonomy URLs?
- Permalinks for quote authors
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Custom taxonomy term as class?
- Using a loop to display terms associated with a post
- get_terms custom order
- Check whether a custom taxonomy term has published posts?
- How to Query Database for posts with certain Taxonomy Term
- Check if term is in a taxonomy?
- Display direct children of the current custom taxonomy in taxonomy.php template
- How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy
- Woocommerce: How to change the add to cart text in a certain category? [closed]
- get_term and get_term_by return null or false, even though term exists
- Can you filter wp_dropdown_categories with terms meta?
- one term two taxonomy’s?
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- quey posts from different categories with taxonomy
- How to create pagination for custom taxonomy in WordPress
- Page and Post return 404 with custom taxonomy
- Order by taxonomy Value [duplicate]
- Checkbox onclick filtering on the same page
- Retrieving an intersection of two terms from two different custom taxonomies via API
- Category list with indent children list below current category
- Some of my custom taxonomies are not showing but still counted in a WPMU set up
- Remove categories from post edit page, but keep in sidebar?
- How to set taxonomy hierarchical level to 2?
- Custom Taxonomy Not Working When added to WordPress Search
- Custom taxonomy terms in the admin site is not saving for widget
- Widget dropdown always displays first option
- How to get posts which must match both custom taxonomies?
- Display all taxonomy, children and grandchildren with links
- Using custom taxonomies to display hierarchical URLs?
- Passing form inputs into multi-taxonomy query
- Custom Taxonomy Tag Cloud?
- Taxonomy Parent Name
- Custom Taxonomy specific to a Custom Post type – rewrite URL
- Having Issue on Passing Variable into HTML Class Tag
- Make child taxonomy categories use a set template
- Copy/clone/associate Custom field to Custom Taxonomy
- Load a certain functions file for a certain taxonomy
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- one post per term taxonomy
- Can’t get taxonomy ID for each post on archive page
- How do I get the labels from a post
- Hide custom taxonomy from easy admin
- Add file attachments/meta to a custom Taxonomy
- Displaying user selected custom tags/taxonomies on the front-end
- Why can’t I access Custom Taxonomy metadata?
- Permalinks with custom taxonomies and regular categories
- WP_Query tax_query – Show results if child has parent X
- Running a function only once when a taxonomy term is changed
- Taxonomy or Custom Field
- Trash Bin for Categories?
- Custom taxonomy – checking if name includes a declared value
- Display just the Post’s parent Category, not child
- Wp_insert_term doesn’t work from separate file with custom taxonomy
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Random order not working correctly when using default loop + $query->set
- Convert post meta to custom taxonomy?
- How to create filter’s for custom taxonomy page
- How to get a taxonomy by a term slug?
- Get taxonomy link with post type slug prefix
- Query by multiple custom taxonomies
- get the custom taxonomy name?
- Modify title of custom taxonomy archive page
- Catchable fatal error: Object of class WP_Error
- qtranslate-x problem with custom term description
- WordPress custom taxonomies new/edit post autocomplete
- Templates files for custom post type with custom tags
- Custom Tax Archive of Parents Only?
- taxonomy query on front page
- Change taxonomy of posts
- Pagination with custom query (not using posts)
- What’s the proper WordPress URL for the template of my custom taxonomy?
- Update fields with post object and custom tax with wp_insert_post
- Get Posts with matching lowest taxonomies
- How to randomise a custom taxonomy tag cloud
- Any way to make custom taxonomy field searchable?
- query posts returns 10 records
- Select Custom Taxonomy from Theme Options
- Remove Tag Cloud Words from Custom Taxonomy
- Add taxonomy fields of posts into RSS feed