• Is it possible to orderby a WP_Query using the term order from taxonomy ‘role’?

    $employees = new WP_Query( [
      'post_type' => 'employee',
      'posts_per_page' => $posts_per_page,
      'paged' => $paged,
      'orderby' => 'title',
      'order' => 'ASC',
      's' => $s,
      'tax_query' => [
        [
          'taxonomy' => 'type',
          'field' => 'slug',
          'terms' => $typeQuery ?: $typesList
        ],
        [
          'taxonomy' => 'location',
          'field' => 'slug',
          'terms' => $locationQuery ?: $locationsList
        ],
        [
          'taxonomy' => 'role',
          'field' => 'slug',
          'terms' => $roleQuery ?: $rolesList
        ]
      ]
    ]);
  • The topic ‘WP_Query orderby’ is closed to new replies.