脚本宝典收集整理的这篇文章主要介绍了php – WordPress – 获取所有数据和排序,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$args1 = array( 'post_tyPE' => 'gallery','posts_per_page' => $gnum,'post__in' => array(400,403),'paged' => $paged,'orderby' => 'tITle','order' => 'ASC' ); query_posts($args1); <?PHP if (have_posts()) : while (have_posts()) : the_post(); ?> //And then some other code to display data
使用’post__in’=>数组(400,在上面的查询中,我正在获取ID =’400’和’403’的行.所以当我回声时,我只能看到两个信息.
现在,我想要实现的是从表中获取所有数据,但是当我显示信息时,我想先得到ID为400的行,然后是403,然后根据’orderby’=>得到其余的行. ‘title’,”order’=> ‘ASC’
你能帮忙查询一下吗?
谢谢
编辑
$args2 = array( 'post_type' => 'gallery','post__not_in' => array(400,'order' => 'ASC' ); query_posts($args2);
以上是脚本宝典为你收集整理的php – WordPress – 获取所有数据和排序全部内容,希望文章能够帮你解决php – WordPress – 获取所有数据和排序所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。