get_posts args:orderby-我可以按字母顺序,库样式排序吗?

时间:2019-02-21 20:44:13

标签: wordpress args alphabetical-sort

我正在查询某些分类法术语的帖子(使用WordPress)。一切都几乎完美,但我还有一定的额外需求。我希望这些帖子按标题排序,但也要采用“库”风格。因此,换句话说,我希望它像下面的示例那样排序,其中它忽略了“ the”和“ a”:

  • Alfie
  • 最好的时光
  • 更改
  • 足底按摩
  • 我们的生活方式

这是我的代码,除了按T等对“ The ...”进行排序以外,它的工作原理还很完美:

    $args = array(
            'posts_per_page' => -1,
            'post_type' => 'song',
            'tax_query' => array(
                    array(
                            'taxonomy' => 'genre',
                            'field' => 'slug',
                            'terms' => $term
                    )
            ),
            'orderby' => 'title',
            'order'   => 'ASC',
    );
    $props_type_posts = get_posts($args); 

对于$ args,我可以做些什么吗?

我尝试使用Google搜索,但是这对我来说很难,因为我不知道要使用哪些搜索字词。

0 个答案:

没有答案