Custom Employee Post Type Sort Last Name
-
I’ve created a custom post type, called Employees. I’m using the post title to hold the employee full name, first and last. I’ve written a custom query to grab the employees, but I need to sort by last name, which is second word in the title (or last). Is that possible?
$args = array( 'post_type' => 'rma_employees', 'posts_per_page' => -1, 'order' => 'ASC', 'tax_query' => array( array( 'taxonomy' => 'rma_employee_type', 'field' => 'slug', 'terms' => 'manager', 'operator' => 'NOT IN' ), ) ); $loop = new WP_Query($args );
- The topic ‘Custom Employee Post Type Sort Last Name’ is closed to new replies.