I found the solution. When I take my first query and make it like this:
<?php
return [
"post_type" => [
"employees"
],
"post_status" => [
"publish"
],
"orderby" => [
"post_title" => "ASC"
],
"posts_per_page" => "99"
];
the sorting is working. So I replaced:
"orderby" => [
"post_title"
],
"order" => [
"ASC"
],
with only:
"orderby" => [
"post_title" => "ASC"
],
This did the trick:)
Related Posts:
- Order custom post type is beign ignored
- Sort custom post type list table by display name of a user id stored as post meta value
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Custom Post type sort order not working in the admin area
- WP insert post PHP function dynamically generated Custom Fields
- Inserting data into `post meta` table?
- Custom Post Type order by modified date and custom meta field issue
- WP_Query search posts by custom post type and custom taxonomy
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- Conditional to modify query results
- Order By Post Type ThenBy Taxonomy
- Custom query to filter posts that have current post as a taxonomy [closed]
- Combining sorted and random CPT
- Wp_query: sort by PHP variable
- creat filter with wp_query
- Custom post type sorting: alphabetical order
- Creating a “glossary” of WordPress posts of a specific post type
- Querying a custom post type, but not show duplicates
- How do I get the index for a custom post?
- Changing WordPress sort order for returned child pages
- How can I sort the order of multiple custom field values in a custom post type?
- Check that a slug is present in the get_terms request
- Wp Query sort order from custom MetaBox
- Using Orderby and meta_value to order natural/alphanumerical
- How to sort custom post’s category by id from the theme’s function.php?
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Show first posts with custom field not empty and order all by title
- Help ordering custom query by Title, Ascending
- Allow admin to determine the order of queries?
- Posts 2 Posts: query connected — orderby problem
- Code in custom widget queries all posts, when it should only query the current post
- Pagination not working with custom loop
- get attachments for all posts of particular post type
- How do I programmatically add items of content to a custom post type?
- How to sort a table of custom posts by column containing custom field
- Ajax filter with custom taxonomies
- Querying Posts by Taxonomy From Alternate Network Site
- Custom post type loops with different page templates
- How can I programmatically save data into custom fields that contain serialized data?
- Row actions not showing? Why?
- Displaying custom post type on front page
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Display custom post types with custom date field value (before today) & order by custom date field
- Dynamic Custom Post Type Plugin
- Link users to a custom post type
- Weird problem happening with custom taxonmy when creating/updating posts
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Custom post type redirected to homepage – how to debug
- CPT + CMB2: data not displaying for only first post in loop
- Query & Order posts by custom fields
- ACF field key/value to show on taxonomy list
- Using custom field content as expression in IF statement [closed]
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Specific query for custom post type
- Prioritize posts in query by meta keys?
- Make a custom_post translatable
- How to update post meta on uploaded image from a custom form?
- WP_Query orderby and tax_query
- Loop increase number
- Is This Code Efficient – Or is there a better way?
- Graphql: Unable to query (where:{author}) for custom post type
- Filter content in shortcode
- Custom post type and custom taxonomy 404 on page 2
- Show current user posts in custom post type query
- Sort column on meta key and meta value
- Sets post_parent in custom post type posts automatically based on cpt->page name
- Front end create custom post types
- How to display “Trash” in my custom post type?
- set object terms after some some time of published post – functions.php
- Change search query in wordpress custom post type
- Sort custom posts by date and then by taxonomy
- Query custom post type that has a serialized relational advanced custom field value
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Sending current featured image to email
- Custom post type sortable columns when column value is from a custom database value
- Plugin Development using classes – Public & Private Callbacks
- Meta query and compare “!=” not working as expected
- Dynamic page for nav items used as filters
- How to use posts as tabs in a custom page?
- Tell wordpress to show a single page instead of an archive page
- Get meta values from parent post and save in child post
- PHP Notice: Unidentified index
- Duplicate posts in my custom loop
- Include images from pages in wp search.php results in default wp search
- get_post_meta for Custom Post Type ( CPT )
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Meta box not saving
- Featured image in custom post is being disabled
- Is it possible to add query parameters on the archive page?
- Custom Search not working
- Ordering custom post type by custom field without a title
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Query Posts From Multiple Post Types
- Pagination not working with custom loop
- Show custom posts with a specific “custom TAXONOMY slug” on startpage
- WordPress Set A Static Page/Template For All Sub-Pages
- Add HTML before a specific div?
- How to hide home title on pages and posts?
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT