It was easy enough to get my custom fields to show up as columns in the wp-admin area of my custom post type but now I need to sort by one of those custom fields. Any ideas?
A:
But of course. This will sort posts by the value of the pant_size
custom field:
$posts = query_posts('orderby=meta_value&meta_key=pant_size&order=DESC');
You can read more about it in this article.
Pat
2010-07-20 00:30:21
Thanks for answering! Wordpress help is a waistland here. Anyway, that's for when you want to display the posts to the user, not the admin area where you can edit the custom posts and that's where I want to change the sorting. I'm thinking maybe I can do it with Javascript and make all the columns sortable while I'm at it but that probably won't work because of paging.
tooshel
2010-07-20 17:52:54
A:
Hopefully the answer to this will end up on the Wordpress stackexchange site.
tooshel
2010-08-11 21:03:59
It did! The answer there is wonderful just in case you happen to end up here instead.
tooshel
2010-08-17 17:08:43