You could use the get_terms_orderby
filter:
add_filter( 'get_terms_orderby', 'wpse156153_get_terms_orderby', 10, 3 );
$categories=get_categories($cat_args);
remove_filter( 'get_terms_orderby', 'wpse156153_get_terms_orderby', 10, 3 );
with
function wpse156153_get_terms_orderby($orderby, $args, $taxonomies ) {
return 'FIELD(t.term_id, ' . $args['include'] . ')';
}
Related Posts:
- Order get_terms() By Custom Field
- Custom query with category exclusion and post-meta “whitelist”
- Custom loop of a single category, cannot order by date. What am I missing?
- Modifying category order
- How to Change the Categories Order in the Admin Dashboard?
- How to get posts from two categories with WP_Query?
- Sorting posts by custom date fields (non standard date format)
- Exclude categories from search query
- How can I reduce the number of database query calls for this custom homepage?
- Get page content by category or tag
- Display all posts in category, with specific tag posts at top
- Trying to perform complex custom field query with order by set to field value
- adding custom fields to next and previous post link
- Order Posts by Closest Numeric Values
- What could be causing my wp_query pagination to break?
- Sorting Posts by custom field
- Order posts by date and then by custom field
- Exclude most recent posts from specific category in wp_query()
- WP Query group/order by category name
- How to Check if a Child Category is Being Queried
- Return category slug / title from category ID
- WP_Query order by date in meta_value
- How to run WP_Query to retrieve attachments to posts only from a particular category?
- How to query posts from specific authors and categories using WP_query?
- Filter out posts before display category count
- How to put enctype=”multipart/form-data” in categories form?
- Add custom taxonomy under the category title
- How to show in search results posts with a particular tag in a particular category?
- Custom WP_Query for current category (in category.php)?
- List Posts by Category for a Non-Zero, Non-NULL Custom Field Value?
- getting content from main domain to sub-domain using category and WP_Query
- Custom order categories in admin dashboard
- WP_Query() returns null when results exist!
- 3 Columns, 3 Categories, One Archive, and Pagination
- WP_Query orderby not working with meta_value_num and menu_order
- How can I sort posts by the date and a custom meta field?
- need to add custom field in more products
- How to redefine the sorting of product categories by menu_order?
- How to change a post category when the ACF datepicker Field is today
- Understanding the orderby in WP_Query?
- Order by empty custom field
- Order categories by name or view count
- Listing Texts of Which Custom Field is Null
- Multiple Loops on category.php with pagination on last loop
- Trying to sort and display categories(not posts) by custom field: ‘order’
- How to get latest posts from each category in regular order
- change recent posts based on category
- How to remove specific categories from posts?
- wp e-commerce group product by category [closed]
- How to query categories with Advanced Custom Fields?
- Set colors depending on category
- How to add custom color fields to the category edit page?
- Notice: Trying to get property of non-object in : custom fields category
- Pagination on category.php and tag.php not working
- Use premade array as categories in wp_query?
- echo get_post_meta of all post in a category to fill up a select field
- How to change the order of the subcategory and category in a post?
- How do order product categories – on a parent category page – in Woocommerce?
- WP_Query – using category__and when one of the categories is 0
- More efficient way to list posts by category [duplicate]
- Adding a block with query in homepage
- Query posts by views on category page
- Sorting posts by Multiple custom fields in defined order
- I need to exclude from a query a category and a few custom taxonomies
- Using in ‘category_name’ in ‘$query->set();’?
- multiple values in an array for category__and does not work with WP_Query
- Custom Page Template Category loop not functioning correctly
- Displaying a custom field in Category Archives
- Select posts that match multiple category names, must match all categories listed
- How to display the 5 latest post titles but allow only 1 in there of a specific category
- Custom Fields Value As Taxonomy
- Update custom category fields front-end
- What is the best way to add an advanced / intermediate / beginner tag to a post
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Adding tinymce to Custom Field boxes on Category edit page
- Sort categories by custom field in WordPress admin
- How to use the Term Object from a custom select field in a query
- Categories In English version showing not canonical URL, instead shows query search result
- How can I add different custom fields for each category in the same post?
- Query post by Category and custom file (ACF)
- How to modify custom category field from front end?
- Ajax Category add doesn’t update the list table custom column
- WP_Query sort by meta_value_num or date
- Configure query with multiple categories in a custom order?
- Order Custom Field by Price
- Unable to get all tags from specific categories
- Display related posts with same category or same tag return blank
- query_posts with sorting on a custom datestamp
- ACF plugin categories bug in WordPress 3.9
- Querying Multiple Categories With Different Offsets
- WordPress Numeric Pagination with Query String [duplicate]
- Printing direct descendants of a category with WP_Query
- Formating content in category.php
- Show only one category in main query, issues on tag page
- Sort categories by meta value
- How do i add custom post types to this query?
- Woocommerce custom taxonomy order
- How to retrieve posts from parent category, splitting them per children when displayed?
- WP_Query sort by ACF date field (newest first) with blank dates first
- Add custom text in second paragraph of posts in specific category