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
- Adding ‘menu order’ column to custom post type admin screen
- Get the ID of the latest post
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Search that will look in custom field, post title and post content
- Load custom posts with same tag as page
- Custom Taxonomy Template Post List with Sort Order
- If featured image doesn’t exist, show post content
- Order Posts by Taxonomy and Meta Value
- How can I add dropdown widget/box to admin post page?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- query order by date on custom type: wrong order
- Taxonomy list. Order by a specific custom post type count
- How to get only one category of custom post type?
- Adding posts of custom type into the main feed
- Error after deleting Custom Post Type with a function (no trash used)
- Change message given when deleting post from custom post type
- How to add new tab to admin list of posts and handle result list
- Calculating Bayesian average for custom post type
- Display custom field of specific post where post title matches variable
- How to filter custom taxonomy categories on archive?
- query posts and custom post type with meta key
- Show Different Header on a Specific Post ID
- Query string parameters from custom fields, inconsistent results
- Custom Post Type Loop throws 500 error when used in widget
- Received nothing after executing AJAX post function
- How to modify archive query with pre_get_posts to append CPTs?
- Sorting custom post type columns with external data and without meta values
- Get parse_query filter to return slug instead of id
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Categorize custom post type
- Function causing the loop display posting more (empty)
- Displaying Posts from Custom Post Types
- Custom post type posts don’t show in archive widget
- categories should be available across all custom post types
- Including all post id’s of a custom post type into an array
- After creating Custom post type by user delete old one
- How to add new post using a form to categories when categories are using as menu
- Different post title, keywords and description
- Function to limit number of custom post types on homepage – TwentyTen
- How to manage a particular “order by” for get_search_query()?
- Post type Echo code is repeating on homepage
- Add custom post type to query
- Is it possible to hide nav menu items only when they are page titles (on specific templates) but not on the dashboard?
- WP Query from two Custom Post type fields as statement
- Grouping custom wordpress post types by acf value
- Display Parent-Child Posts in specific order by comparing IDs in array
- Show code dependant on CPT & category
- Adding featured image to a new post using front-end form?
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- Getting a Post ID to show its content in a Popup
- How to sort by multiple values in a nested WP_Query
- wp_post_delete is deleting all offices
- current-post-parent for custom post type
- Having issue on Loading Meta Data From CSV to CPT
- The most recent post of custom taxonomy
- Meta Box not being added in plugin
- Custom post order when using OR relation
- Custom post type taxonomy not sorting correctly
- How would I get a list of posts from a custom post type
- Add number in increment of one to DIV ID
- sort custom post type by display name
- Custom Portfolio String
- What is the most efficient way to manage changes my product comparison tables?
- Dynamically change Custom Post Type Template OR Change Permalink?
- WordPress search results
- WP_query orderby not working after WP4.0 update [closed]
- WordPress Admin Page Slow. Customer Post Type is the slowest
- Store custom post type with JSON content