Use the pre_get_posts
action to modify the query before it is run. Place this in your theme’s functions.php
:
function wpd_tax_alpha( $query ) {
if ( $query->is_tax('link-category') && $query->is_main_query() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
}
add_action( 'pre_get_posts', 'wpd_tax_alpha' );
Related Posts:
- Exclude a category from WP_Query
- Show Post Count of a Category
- Querying Term Posts in Loop
- Custom-Posttype & Custom Taxonomy WP_Query
- WP the_posts() on single-cars.php get category link
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- query multiple taxonomies
- Custom Taxonomy with Custom Post Type Finds No Posts
- How to filter custom post types by custom category taxonomy
- How to list all categories and tags in a page?
- Custom query – alternate posts by category
- remove support for ‘Categories’ for a custom post type
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Glossary with Custom Post Type
- List with categories, subcategories and posts of custom posttype
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- Want to filter only parent post in admin area
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- Query Custom Post by Category
- Custom post query by taxonomy
- Display Custom Category (taxonomy) Name in Custom Post Type
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Help with CPT template pagination
- CPT posts listed by category with custom rewrite URL, please help!
- Combining custom post type and post category
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Insert HTML inside link in a walker
- Set menu active state for custom posttype and category, given custom taxonomy term
- Display all posts in main category and 1 subcategory
- Query/list all terms and their custom post count
- Wrong request query on cpt and tax
- Pagination for Custom Taxonomy Page [duplicate]
- Search / Filter posts on Title/Content OR Tags
- get_category_parents for custom post type taxonomy
- Custom loop with multiple taxonomy queries
- How to display custom taxonomies with links in filter menu?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Custom taxonomy rewrite give pagination 404
- Hide parent categories when clicked, and show it’s childs
- What’s the WP way to load remaining custom posts?
- How to have this permalink structure: post_type/postname/custom_inner_page
- How to get custom posts sub category link
- Advanced search form with filters for custom taxonomies
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Creating two loops based on different logic
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- WP_Query parameter conflict
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- category list with cutom post count
- Include custom post type custom taxonomies in Categories widget
- How to show all taxonomies within custom post type loop
- Custom post type categories gives 404 error
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Foreach loop returning more than one item when querying taxonomy
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Loop and add Specific Categories and Products Images
- Custom post type specific category box
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- Sorting the Loop by Taxonomy Value
- Ordering by meta value not working
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- How to output custom post type title on custom page with category next to it?
- Create custom post type categories
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Live search by custom tag
- Set a Default CPT taxonomy by taxonomy id
- Query a custom taxonomy in a function to create an csv file
- How to manage a dynamic multi-level page hierearchy system?
- Custom Post By Category
- Ajax load more inside custom post type taxonomy
- Categories manage
- Only show categories that have posts within custom post type
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Display all Custom taxonomy terms and their relevant custom posts
- Help with Multi Level Category Archive Page
- Ordering Posts List By Taxonomy Terms?
- CPT Efficient way to display posts from different categories with custom query
- Query Pulling the same post twice
- Get posts associated with custom taxonomy alternate way
- Custom Post Type + Category archive
- tax_query showing no results
- Values inside a custom field to determine which category posts to display
- How to display elements of different post types?
- Trying to create hierarchy between 3-4 custom post types
- Display a custom post type list by taxonomy term
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Custom Post Type order Title ASC
- get tags from custom post type
- Highlight specific menu item when custom post is page
- Attaching multiple custom taxonomies to one CPT?
- Are custom posts included when getting a categories’ posts?
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Dynamically count the number of custom post types associated to a custom taxonomy