Ordering the WordPress custom post types by a Custom Field value has never been easier since the latest version of the Advanced Post Types Order plugin. Forget about long codes, template files, error messages and lots of tries, just use a simple interface, chose the options and the plugin does the work for you on the fly! Yes, that’s right you don’t need to know anything about programming to control that.
Here is a simple way to follow to achieve this:
Within the custom post type re-order interface chose the required Taxonomy, in our case Categories, then select a Term, in my example a category named Blog.
Chose Automatic Order and select the Custom Field option from the list. In the Custom Field Name type in the post meta name you need to sort on
Click Update and you are done.
Is this functional for any post types or only for Posts?
All default/custom defined WordPress post types are supported for this feature to be used along with.
This will work for any WordPress custom post types, either default (post, pages) or custom defined.
If I’ve created my post types using the WordPress register_post_type() function, is there a parameter I need to add in to that code to allow your plugin to work?
There are no additional requirements for the Advanced Post Types Order plugin to work with your custom post types no matter the way you create those, either through code using register_post_type() or by using a custom plugin
Thanks for your reply.
That’s odd, the post types I’ve created using Custom Pot Type UI plugin show the re-order menu, but the ones I’ve created using a function don’t and not sure why.
You must be using the wrong hooks to register your post types, check this page for more info
Yea, thats what I’m using. The problem was my post type was set to ‘hierarchical’ => true, when it needs to be ‘hierarchical’ => false.
May have been my error if this is in the plugin documentation.
Daniel are you sure you use the Advanced Post Types Order plugin? As it support both hierarchical and non-hierarchical structures.
The hierarchical only work with the premium version.
Hi,
I use wordpress 3.5.1
I have this error when i click the update button to reoder my custom type post in admin (wp-admin/load-script.php – jQuery v1.8.3) :
Error: cannot call methods on sortable prior to initialization; attempted to call method ‘serialize’
Can you help me ?
Hi,
Please download the latest plugin files using the personal link you got when bought the plugin which will fix the problem.
Hi,
It resolved the problem,
thanks
Will this support sorting by custom attributes?
Presuming your attributes are saved as postmeta data (however there is no other way to do that by WordPress default) you will be able to sort by that.
Hi, I have added this plugin and reordered using tags but for some reason it is still not reordering in the way I’d like; only in descending date order. Any ideas why? http://roselandonline.co.uk/Cornwall_Roseland_Peninsula/arts-crafts/
Hi Mark,
Is the Autosort functionality set as ON? Otherwise try to include ‘orderby’ => ‘menu_order’ within your theme file query. More details can be found at https://www.nsp-code.com/advanced-post-types-order-api/sample-usage/
If still not working please get in touch with use through contact and we will check into this.
The new posts are going to the bottom of the sorted list, how do I place them at the top?
Check with this post https://www.nsp-code.com/advanced-post-types-order-description-and-usage/understanding-sort-list-settings-area/ at “Send new items to bottom of list” this need to be set for No.
can I add a header and a picture to every title?
If you mean to create a header and picture information for every post as custom fields, then sort by those, Yes it will work.
When I try to activate, I get the following error, can you help please?
Fatal error: Cannot redeclare cpto_activated() (previously
declared in
/home/content/04/7091804/html/awards/wp-content/plugins/advanced-post-types-order/advanced-post-types-order.php:44)
in /home/content/04/7091804/html/awards/wp-content/plugins/post-types-order/post-types-order.php on line 23
You need to de-activate the free Post Types Order plugin before use the paid code.
Post Types Order is already de-activated, are you saying I should delete it?
The error message say that it’s still active. Please double check on that. If still not working, yes try to delete.
I’ve now deleted it and have succesfully de and re activated Advanced Customer Posts. I have an outstanding issue that it won’t recognise and auto sort on a custom field. The website is http://thebookawards.com/awards/current-voting/ and I use a plugin called Post Ratings for up to 5 star ratings for each post. There’s a Top Posts sidebar which picks up the highest voted posts and lists them and the ‘votes’ custom field shows as an option when I display custom fields. However, if I select it Advanced Post Types doesn’t list any of my posts. I thought that re-activating might help but it hasn’t. Can you help please?
We already checking into this, per yesterday support request through contact. Let me ask the support member to send a progress to your e-mail.