2016-11-17 14:23
浏览 10

订购ACF Wordpress

I am having some trouble with ordering my output using Advanced Custom Fields in WordPress. they where working nicely before but I had to make some alterations.

So I need my list to order by the number of signups (meta field) and it was before, but now I have added another field it no longer orders them in a particular order.

    $posts = get_posts(array(
      'post_type'     => 'schools',
      'posts_per_page'  => -1,
      'meta_key'      => 'signups', 
      'orderby'     => 'meta_value_num',                 
      'meta_key'      => 'region',    
      'meta_value'  => 'SW1', 
      'order'       => 'DESC'                         

I have tried to lookup why but I am coming up stuck with it. So it is a leaderboard where by the highest number is at the top naturally and ascends down.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题