Title: Oder by name
Last modified: August 31, 2016

---

# Oder by name

 *  Resolved [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/)
 * Hello – thanks for the plugin. Really helping us out. I have a custom post type
   for ‘staff’ and I want to order them alphabetically by Last name. I normally 
   do this by using orderby ‘name’ which is the slug or permalink.
 * So
 * Title: Gordon Langley
    Slug (name): langley-gordon
 * Would it be possible to add ‘orderby name’ to your plugin.
 * Thanks!
 * [https://wordpress.org/plugins/category-custom-post-order/](https://wordpress.org/plugins/category-custom-post-order/)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/oder-by-name/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/oder-by-name/page/2/?output_format=md)

 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6937994)
 * It’s done. Now you have new order field (slug).
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6937997)
 * Wow! That was quick. What is the version number please?
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6937998)
 * I got it 1.4.2
 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938003)
 * 1.4.2 it is current stable
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938006)
 * Hello – I’m sorry but order by Slug is not working for me. It seems to gives 
   me the same result as ‘default’ and ‘ID” – which is not by ‘slug’.
 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938013)
 * Are you sure. It works for me. If you can, add to archive loop <?php echo $post-
   >post_name; ?> and see if it works.
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938021)
 * Just trying a few things and testing my template.
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938164)
 * I have tried everything I can think of – even using the default twentytwelve 
   theme archive.php.
 * I can’t get the ordering to change when I select slug on a custom post type with
   a custom taxonomy term.
 * taxonomy-position-staff.php
 * I’m sure there is something wrong in my code somewhere!
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938196)
 * Ok – if I deactivate the ‘Post Order’ plugin I can get the ordering to work in
   my archive template, but I need manual post ordering for other custom post types–
   is there a filter (not sure of terminology) I can use so that suppresses it’s
   effect on a particular post type?
 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938198)
 * Are you using custom wp_query in taxonomy-position-staff.php?
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938200)
 * Er… no. I’ve been using shortcodes in the php template. I’ve tried using various
   types of queries, but they all gave me the same result.
    Also I used the default
   twentytwelve theme archive.php and it won’t respect order by ‘Slug’.
 * It’s not a massive issue for me, I’m sure it’s something I’ve done my end. But
   one solution would be to get your ‘Posts Order’ plugin to ignore my custom post
   type ‘people’… or maybe you could take a look for me, it’s driving me nuts.
 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938224)
 * Please copy this code to archive.php
 * <?php global $wp_query; print_r($wp_query->request); ?>
 * And paste results.
 * You need to know that the plugin orders posts only for the main query.
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938258)
 * Hello again – here are the results, I have set the ordering to ‘Slug Decending’–
   the posts seem to be in date order, thanks
 * ELECT SQL_CALC_FOUND_ROWS ce2015_posts.ID FROM ce2015_posts INNER JOIN ce2015_term_relationships
   ON (ce2015_posts.ID = ce2015_term_relationships.object_id) WHERE 1=1 AND ( ce2015_term_relationships.
   term_taxonomy_id IN (132) ) AND ce2015_posts.post_type = ‘people’ AND (ce2015_posts.
   post_status = ‘publish’ OR ce2015_posts.post_status = ‘acf-disabled’ OR ce2015_posts.
   post_status = ‘private’) GROUP BY ce2015_posts.ID ORDER BY ce2015_posts.post_date
   DESC LIMIT 0, 10
 *  Plugin Author [Piotr Po](https://wordpress.org/support/users/potreb/)
 * (@potreb)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938259)
 * Are you using some plugin/shortcde to display your custom post type?
    I asked,
   becouse my plugin support only main sql queries. That means, if you don’t use
   core template to display custom posts, orders will not work.
 *  Thread Starter [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * (@gordonlangley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/#post-6938260)
 * All other ordering options work for me on my custom post types except for by ‘
   slug’.
 * I am using several shortcodes and plugins in the site so I appreciate there my
   be a conflict, however ordering by ‘slug’ doesn’t work on the default archive
   template for twentytwelve.
 * Is there a function I can use to stop your plugin from effecting a specific custom
   post type, (people) as I only need to order by slug for that custom post type.
   I am using order by ‘custom’ for the other post types and that works great!

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/oder-by-name/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/oder-by-name/page/2/?output_format=md)

The topic ‘Oder by name’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/category-custom-post-order_ffffff.
   svg)
 * [Posts Order](https://wordpress.org/plugins/category-custom-post-order/)
 * [Support Threads](https://wordpress.org/support/plugin/category-custom-post-order/)
 * [Active Topics](https://wordpress.org/support/plugin/category-custom-post-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/category-custom-post-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/category-custom-post-order/reviews/)

 * 19 replies
 * 2 participants
 * Last reply from: [gordonlangley](https://wordpress.org/support/users/gordonlangley/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/oder-by-name/page/2/#post-6938347)
 * Status: resolved