What kind of control do you want exactly? There are, for example, plugins that provide a UI through which you can order posts by various parameters.
If you just want to order them all by one parameter that will not change, you can simply add it to your query (since you can order by multiple conditions):
if ($query->is_search) {
return $wpdb->posts . '.post_type DESC, title DESC';
}
Edit: here’s another question you might find useful.
Related Posts:
- I did group my search results by post type, but how can i give each of them its own order?
- Adding ‘menu order’ column to custom post type admin screen
- How to make a WP_Query search with custom post types?
- Displaying a custom post type alphabetically
- Search multiple custom fields by using meta_query
- How do I Paginate Search Results for Custom Post Types?
- WordPress post sorting with AJAX
- Why have my custom post type searches stopped working after changing URLs / updating WordPress?
- Search that will look in custom field, post title and post content
- Ordering posts having multiple post-meta date fields
- Returning search results by relevance, including Custom Post Types
- How to replicate some of Drupal Views functionality in WordPress?
- Seperating Custom Post Search Results
- Exclude from search all custom posts which are NOT in a taxonomy term
- Exclude a term of a taxonomy with a custom post type in a search
- Order Posts by Taxonomy and Meta Value
- Custom Post type sort order not working in the admin area
- Separating Search Results By Post Type
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Custom Post Types: pretty search URLs and has_archive
- WordPress Admin Panel search posts with custom post meta values along with title
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- ascending order custom post type
- query order by date on custom type: wrong order
- Taxonomy list. Order by a specific custom post type count
- No results searching custom post type in admin panel
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- error in Advanced Search Form for Custom Post Types in WordPress array_key_exists() expects parameter 2to be array, string given
- Search Custom Post Type Custom Fields
- Custom Post Type not appearing in website search
- CPT Search Form with Taxonomy filter & Or
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- Custom search for custom post meta with pre_get_posts interferes with WP search
- WooCommerce product search titles only
- Ordering posts in Search & taxonomy by post_meta
- custom post type Search returns No Results in admin panel
- How to set order for a custom post type
- Search Custom Post Type & Taxonomies
- Sort CPT archive by order prevents sorting in admin
- WordPress sort search results by custom order
- How to order and group custom post type posts by year and month
- Pretty URL for custom search for custom post type
- Order Custom Post Type by Custom Field Value
- Add post location with mile radius allowing search
- Include custom post type content in search
- Get post count for search result based on post type
- search suggest – filter post type
- Get the taxonomy of a post hierarchically
- Change sort order when using ‘orderby’ => ‘type’
- How do i search authors from search form using author’s name
- Searching Custom Fields
- Manage Columns : order by post_parent’s title
- Can NOT search my custom post type?
- Archive not sorting correctly
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Add a custom meta box for client to order CPT posts how they want
- Custom post_type search pages
- WordPress search and date filter not working with custom post type
- Custom filter for main search: how to exclude specific post_type from search results
- Add custom attributes to a post
- Display an icon based on post type
- how to get this tax_query working?
- Custom Taxonomy Search result page
- How to group search results by post type and only if post type result is not empty?
- find custom post type post by searching its custom field with my string
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- WP_Query of custom post type sorted by meta_key has unexpected results
- What is the correct term for a tool that filters content based on metadata?
- Ideas on how to organize a project [closed]
- Filtering custom posts by custom fields (ACF) [closed]
- CPT, meta-data, url parameter
- Adding Page Ordering to a Custom Page Type
- Displaying Portfolio Filter by Category Order (alphabetically)
- Modifying search results based on post_type
- How to Implement Search Functionality?
- Order posts by taxonomy terms
- Change search query in wordpress custom post type
- wp rest api orderby field in a custom table
- Create a post automatically if search result has zero results
- order custom post type posts by custom date
- Query first and last name from custom post type
- Wp Query sort order from custom MetaBox
- Custom Archive – hide posts until a search is made?
- Display result as “prefix+ID” and show in the search result as bookcode
- custom search results – order results differently by post type
- How to sort custom post’s category by id from the theme’s function.php?
- Show first posts with custom field not empty and order all by title
- Custom Post Search
- Help ordering custom query by Title, Ascending
- Search form to find custom meta box generated data
- 404 error Custom search results page for custom post types with friendly URL
- multiple custom post type category selection search
- Custom Search Template for Custom Post Types
- Custom Post Type Order Index Loop
- Search page for custom post type
- Cannot get query var ‘post_type’ to work
- Archive custom template from search
- Customising wordpress search and using $_GET[“s”]
- Allow admin to determine the order of queries?
- search this custom post type