wordpress调用文章数量numberposts

        在调用文章时,如果不指定numberposts数量,默认为5,如果指定了一定数量,那么就调用指定的条数。如果想要调用所有,那么指定为-1即可。如下:

$relates = get_posts(array(
    'post_type' => 'propertyawardwinners', 
    'numberposts' => -1, 
    'tax_query' => array(
    array(
        'taxonomy' => 'country',
        'field' => 'slug',
        'terms' => array($tax_country),
        'include_children' => false
    )
  )
));
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容