开发者

Sort the admin area of a Wordpress custom post type by a custom field

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 fie开发者_运维百科lds. Any ideas?


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.


Hopefully the answer to this will end up on the Wordpress stackexchange site.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜