Ok I have figured it out; added the following to functions.php:
add_filter( 'posts_request', 'my_request_filter', 10, 2 );
function my_request_filter($sql, $query) {
if($query->is_main_query() && is_search()) {
$sql = "SELECT * FROM wp_posts WHERE post_content LIKE '[smoothslider%' AND post_parent !='0'";
}
return $sql;
}
I understand that with no access to the database or being able to run test my slider it was only guessing so I’ll check your answer as accepted answer anyway.
Thank you for your help.
Related Posts:
- Filter admin ajax data by url query
- How to use jQuery validation to set the search bar to accept only a specific input?
- Can I force WP_Query to return no results?
- Post_count only shows the number of results per page
- WP Query where title begins with a specific letter
- IP address character limit
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Tracing the life of a query
- Pagination broken when merging search results with additional WP_Query
- Custom search form with empty parameters
- Multiple keyword search
- Multiple search queries on one page
- WP Query search for attachments and their exact title
- Including only current user’s posts in search
- Custom category search box for WordPress
- Refine search results using WP_Query
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Search Posts with Custom Fields as query
- Creating a custom search for a specific post type
- Custom Search Result Page displaying only 1 result.
- Assigning a meta_query value based on regexp to wp_query fails
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- Search pages that are a child of the current page
- Include tags in WP_Query
- Search for multiple tags?
- Custom Search Not Consistent with Results
- wp_query ‘s’, search filter with pagination is not working
- How to use wp_query to post count by search term > group post count by date > convert to json. (ex. result 12-21-2020 – 343)
- Load More Posts Button – AJAX
- Extend product search with meta in WooCommerce
- Display filtered results into custom page
- Cutom wp_query for geolocation search, pagination not working
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- query_vars overriding WP_Query args
- Query with search and subscribers only output
- how can I override The Events Calendar query modifications?
- Search for “2nd” also returns “22nd” in wp_query
- Filter wordpress post categories with jquery/ajax and pagination?
- How do I get my custom query to work with search results after the first page?
- Modify Search Query if original Query gave no results
- how update data through ajax and jquery
- Include post content of linked posts in search
- Replacing search results with custom external query
- Prevent author bio page from showing in search results
- How do I amend wp_query before it is run/executed?
- wp_query search not taking keywords with together for multiple words
- WordPress Custom Search Form Displaying Unexpected Results
- How to properly use AND / OR in custom search
- How to avoid bypass of search bar rules?
- Hide products in uncategorized category from search results
- Loading two different AJAX requests on two different pages
- How do you determine if a result in a search query is a post or a page?
- Slow Query On Search
- How To Keep Search Title the same on paged Results
- wp_query show all values
- How to restrict search on a certain page to only return results against custom taxonomies?
- Filter out a meta key in the Search results page with two CPT
- Query by key or author
- Ignore image urls in wp_query search
- Can I make a search query which includes a space?
- Ajax (jquery) wp_query pagination returns -1
- WordPress search WP_Query to cover multiple post types and their custom fields?
- My combination of ‘post_type’ and ‘tax_query’ not working?
- WordPress AJAX Request returns 400
- How to make the WP query search for the “s” arg in other places too
- Excluding posts from search results page with meta query not working
- WP_Query no result if keyword contains number
- Multiple WP_Query args combinations according to post type
- WordPress live search and filter custom fields
- WordPress live search and filter
- How to extend WP_query to a specific table?
- Display the search results like the original pages
- Finding post ID dynamically on click
- Display Search Results by tag_ID in my search.php
- getting posts by tags
- Add to search posts query array with post IDS which will appear first
- Custom Post Type WP_Query with filters and search
- WordPress search page pagination displaying but not functional
- Search has query that will return no results
- WP Query – Search in title or author_name
- Get posts by similar names and categories
- Logging search queries for logged-in users
- How to show terms from another taxonomy
- Order & Orderby clause not working with custom query
- How can I modify standard search query to include also ACF custom fields values?
- Search format not matching taxonomy query
- Search Functionality broken by the wp 4.2 update
- Custom search (wp query by custom fields)
- Custom Search Query – include only custom fields and title
- $wp_query when new WP_Query
- Need help setting up a search form for wordpress [duplicate]
- Loop the posts between two dates selected using jquery datepicker
- Search (Custom Form, Custom Search Result)
- Help with showing text when something is entered in my search bar
- Filtering product search results using tags
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- How does Show Posts based on a keyword search work in WP_Query
- AJAX search function resets wp_query vars
- WordPress Ajax search filter on dropdown select