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
- Admin custom post ordering
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Selecting New & Edit Page for Custom Post Types
- Show Two custom Post type and their posts on category page
- How to filter custom taxonomy categories on archive?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Modifying date filter on admin page for custom post type to link to custom field
- Ignore sticky posts if post is not in meta query
- Loading all files within a directory
- Querying Term Posts in Loop
- How to debug a blank page?
- Blog page showing same content as homepage
- query posts and custom post type with meta key
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Custom post type ‘orderby’ => ‘meta_value’ not working
- Create custom post type on successful woocommerce order [closed]
- Query string parameters from custom fields, inconsistent results
- Custom Post type is being ignored in query
- How to rank custom post type from score points
- Adding custom tables to WordPress
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Query custom post type only if it contains another custom post type
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Add post_type to index.php
- Sorting multiple custom post types without a meta key/value pair by sort order
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Getting the URL of the parent page
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- How to display selected taxonomies by their parent
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Custom Field Order by Last Name and First Name
- Pagination for custom php code
- get_posts of Custom Post Type AND Custom Taxonomy
- What’s the difference between same wp functions get_posts(); functions in different form?
- I did group my search results by post type, but how can i give each of them its own order?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Ordering posts in Search & taxonomy by post_meta
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?
- Am unable to reset a query properly
- Get posts from a custom post type by child categories of a parent category
- Received nothing after executing AJAX post function
- How to make sure content doesn’t display if selection is empty
- Custom post type redirected to homepage – how to debug
- How to modify archive query with pre_get_posts to append CPTs?
- Custom Post-Type not in admin menu
- get the custom post type title/name