You can use FIELD or FIND_IN_SET:
return "FIELD(mt1.meta_value, 'Head Teacher', 'Deputy', 'Teacher', 'Support', 'Clerical') ASC, mt2.meta_value ASC";
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field
Related Posts:
- Sorting posts by custom date fields (non standard date format)
- Order posts by date and then by custom field
- Revolution Slider Orderby Two Custom Fields
- Order Posts by meta value AND published date
- Understanding the orderby in WP_Query?
- Order by empty custom field
- meta_value_num not ordering all items
- Order 2 meta_queries differently in WP_Query?
- Order Custom Field by Price
- query_posts with sorting on a custom datestamp
- WP_Query sort by ACF date field (newest first) with blank dates first
- WP_Query – Order results by meta value
- Can wp_query return posts meta in a single request?
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- Order by optional meta key?
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get order of posts?
- Get_post() with meta_key when compare is a date
- querying with custom meta field with meta_query
- Group posts by custom field
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Merge 2 args in one WP_Query and order it by date
- getting posts and number by specific meta value in multiple meta
- How to query using a combination of custom_field values?
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- WordPress altering my custom query, How to fix it?
- Order by meta_key in custom post type doesn’t affect the query
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- wp_query with multiple custom fields
- Display link to taxonomy archive only if it has posts with certain custom field values
- WP_Query Order by Specific Post ID First
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- Group WP_Query by meta_key date
- Orderby ASC changes to DESC in WP_Query
- Display custom field meta outside loop, site wide
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Query posts without meta preload
- Adding multiple meta_key fields as orderby options to a WP Query via a function
- Order Custom Post Type by Custom Field Value
- Advanced ordering of query_posts
- Query all posts if multiple meta key don’t exist
- meta_compare not comparing whole integer
- wp_query to print posts if have X custom field value
- Why is WP_Query not displaying expected data?
- How to Create a Random List of Child Pages
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- Order post type by sum of two custom fields
- Specify strict ‘order by’ in WordPress query
- How to order posts on each different category?
- Get every post with value in meta key
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- Order WP_Query results by meta key value in custom query
- How order posts from category by date and comment count?
- WP_User_Query orderby meta_val_num
- WP_Query custom order and pagination
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- WP_Query order by multiple meta keys & fields
- How do i create a custom post query when the meta value is an array?
- How to add a “base” filter for all posts visible to visitors on the site?
- WP Query – grouping posts by same meta key, adding together values from another key
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- meta_query is overriding default search
- Custom order of posts in wp_query and different taxonomies
- WordPress Query custom ordering by temporary variable
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- WP_User_Query Orderby Not Working
- Query Order By Number Variable From API
- using custom meta user data to run queries in WordPress
- Order posts by title and custom field value?
- How to create URL parameters to run custom queries?
- Order & Orderby clause not working with custom query
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Custom WP_query and integrating into theme file
- Best way to Order Post in Home without a plugin
- Query All Attachments and Order by Parent Publish Date
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Sorting posts by meta values: 2 different orders
- Sorting Posts with meta value not working
- Order by three custom fields (Y-m-d), then separate into yearly sections
- Order posts by custom column using pre_get_posts
- Add filter to Orderby Parameter using Array
- Loop through multiple custom fields with increasing number
- Order WP_Query results in order other than ASC or DESC
- Custom query to order by multiple taxonomies
- new WP_query using custom fields
- Sorting: custom query with orderby meta_value_num THEN by title
- Get post closest to today
- query post based on comparison
- orderby in WP_query doesn’t works
- 404 on Pages for Custom Post Type & Query_Posts
- Order by meta values
- orderby and order filter in get_posts or WP_query function in wordpress not working
- Get posts by meta value except one post [closed]