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
- WP_Query – Order results by meta value
- Get all categories and posts in those categories
- How to Change the Categories Order in the Admin Dashboard?
- Combine two taxonomies in a hierarchical tree
- How to get posts from two categories with WP_Query?
- Group WP_Query by category
- WP_Query to show post from a category OR custom field
- Sorting posts by custom date fields (non standard date format)
- Exclude categories from search query
- get_field not displaying my custom field value
- How can I reduce the number of database query calls for this custom homepage?
- WP_Query not looking at child category
- Sort posts by tags in category pages
- Get page content by category or tag
- Display all posts in category, with specific tag posts at top
- Add extra fields to Add New Category page
- Need help adding custom field to category
- I want to order categories based upon the latest post time
- Trying to perform complex custom field query with order by set to field value
- adding custom fields to next and previous post link
- Excluding posts from a category but only if they’re not in multiple categories
- Order Posts by Closest Numeric Values
- What could be causing my wp_query pagination to break?
- Sort category page with custom field
- Create a full width responsive header image per page
- Sorting Posts by custom field
- Order posts by date and then by custom field
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- Exclude most recent posts from specific category in wp_query()
- Revolution Slider Orderby Two Custom Fields
- WP Query group/order by category name
- Order posts by category name
- Display one latest post from multiple categories
- How to Check if a Child Category is Being Queried
- Return category slug / title from category ID
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- 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?
- Order Posts by meta value AND published date
- 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
- Arrange posts by date in front page
- WP_Query() returns null when results exist!
- Ignoring a category in WP_Query still shows the links in next_post_link()?
- 3 Columns, 3 Categories, One Archive, and Pagination
- Enter a variable in the ‘category_name’ parameter
- How to query post like normal search would do. within search.php page
- 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?
- How to call custom category field data in theme?
- query in category.php repeats itself
- need to add custom field in more products
- How to redefine the sorting of product categories by menu_order?
- Retrieving category’s color with get_term_meta
- 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
- Order Custom Post Type by Custom Field Value
- WooCommerce – How to show specific category first-rest of products-specific category last
- meta_value_num not ordering all items
- Listing Texts of Which Custom Field is Null
- How to “group” (categorize) the Pages together?
- 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
- Custom taxonomy/category order
- I want to display the all the posts that are inside a certain subcategory
- change recent posts based on category
- How to remove specific categories from posts?
- wp e-commerce group product by category [closed]
- List posts in alphabetical order
- How to query categories with Advanced Custom Fields?
- Redirect to another page using contact form 7? [closed]
- 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
- Display posts from a category
- Pagination on category.php and tag.php not working
- category__not_in and id values from variable
- Use premade array as categories in wp_query?
- echo get_post_meta of all post in a category to fill up a select field
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- How to change the order of the subcategory and category in a post?
- “Virtual category page” based on a custom field filter
- How do order product categories – on a parent category page – in Woocommerce?
- How order posts from category by date and comment count?
- ACF no print data [closed]
- WP_Query – using category__and when one of the categories is 0