| 开发者 |
jakemgold
thinkoomph 10up |
|---|---|
| 更新时间 | 2012年10月21日 03:31 |
| 捐献地址: | 去捐款 |
| PHP版本: | 3.0 及以上 |
| WordPress版本: | 3.4.2 |
post__in parameter. Unfortunately, the orderby parameter does not offer an option that will sort the result by the exact order passed in the post__in parameter. This plug-in adds a post__in option for the orderby parameter that will order the result by the exact order specified in the post__in parameter.
And don't worry about the plug-in being deactivated - your post queries with the new post__in value used for orderby will simply gracefully fall back to the default date sorting.
/wp-content/plugins/ directoryorderby parameter set to post__inquery_posts( array( 'post__in' => array(20,10,106), 'orderby' => 'post__in' ) );
That will retrieve posts with IDs 20, 10, and 106 in that order!post__in