WPIntell

Source evidence

Oder by name

Posts Order · support · 2016-01-13T11:32:00+00:00

mixedsentiment
mediumseverity
0.84relevance
19replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 28 rows with source links

21.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

22 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
gordonlangley resolved
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/ It’s done. Now you have new order field (slug). Wow! That was quick. What is the version number please? I got it 1.4.2 1.4.2 it is current stable 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’. Are you sure. It works for me. If you can, add to archive loop <?php echo $post->post_name; ?> and see if it works. Just trying a few things and testing my template. 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! 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? Are you using custom wp_query in taxonomy-position-staff.php? 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. 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. 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 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. 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! Can you change ordering to by ID and copy sql query for me. I need to check this. Is very wired that solution doesn’t work. Works great… SELECT 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.ID desc LIMIT 0, 10 Hello? 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! Hello Great news! Your update has fixed my issue with order by ‘slug’ – Many thanks for your hard work!!

Comments

19 shown
Piotr Po 2016-01-13T11:57:00+00:00

It’s done. Now you have new order field (slug).

gordonlangley 2016-01-13T12:08:00+00:00

Wow! That was quick. What is the version number please?

gordonlangley 2016-01-13T12:09:00+00:00

I got it 1.4.2

Piotr Po 2016-01-13T12:21:00+00:00

1.4.2 it is current stable

gordonlangley 2016-01-13T12:23:00+00:00

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’.

Piotr Po 2016-01-13T12:37:00+00:00

Are you sure. It works for me. If you can, add to archive loop <?php echo $post->post_name; ?> and see if it works.

gordonlangley 2016-01-13T13:05:00+00:00

Just trying a few things and testing my template.

gordonlangley 2016-01-13T18:36:00+00:00

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!

gordonlangley 2016-01-13T22:01:00+00:00

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?

Piotr Po 2016-01-13T22:10:00+00:00

Are you using custom wp_query in taxonomy-position-staff.php?

gordonlangley 2016-01-13T22:20:00+00:00

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.

Piotr Po 2016-01-14T09:12:00+00:00

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.

gordonlangley 2016-01-14T13:44:00+00:00

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

Piotr Po 2016-01-14T13:55:00+00:00

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.

gordonlangley 2016-01-14T14:22:00+00:00

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!

Piotr Po 2016-01-14T14:24:00+00:00

Can you change ordering to by ID and copy sql query for me. I need to check this. Is very wired that solution doesn’t work.

gordonlangley 2016-01-14T15:05:00+00:00

Works great… SELECT 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.ID desc LIMIT 0, 10

gordonlangley 2016-01-18T17:35:00+00:00

Hello? 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!

gordonlangley 2016-01-19T13:03:00+00:00

Hello Great news! Your update has fixed my issue with order by ‘slug’ – Many thanks for your hard work!!