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?
- Redirect Search to Form When No Product Results Are Found
- How to properly use AND / OR in custom search
- Change AJAX filter from POST to GET for URL Parameters
- 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
- Issues with search after added meta_query
- How do you determine if a result in a search query is a post or a page?
- Slow Query On Search
- Sorting search results with custom dropdown
- How To Keep Search Title the same on paged Results
- wp_query show all values
- change posts_orderby of the callback wp_query?
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- 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
- Search.php – return number of results but cannot loop through
- Can I make a search query which includes a space?
- How to filter a static post page with ajax and $wp_query
- Ajax (jquery) wp_query pagination returns -1
- Searching not only by post name but also category
- $wp_query->found_posts not returning correct value
- How to search by slug and old slug in single API
- 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 prevent WP_Query from filtering on ‘s’ but keep ‘s’ for other purposes?
- Block internal search queries with pre_get_posts and regex rules
- Add dynamic search to paginated WP_Query
- How to make the WP query search for the “s” arg in other places too
- Search Exact on WordPress – Relevannsi Solution Not Working
- Excluding posts from search results page with meta query not working
- Pagination repeating posts on search results
- I have problems with the search query using multiple post types
- WP_Query no result if keyword contains number
- Multiple WP_Query args combinations according to post type
- Categories In English version showing not canonical URL, instead shows query search result
- WordPress live search and filter custom fields
- WordPress live search and filter
- Slick slider for post doesn’t display anything
- 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
- How to debug none working search query?
- 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
- Search with WP_Query, but ignore href URLs in anchor tags?
- WordPress search page pagination displaying but not functional
- Search has query that will return no results
- WP Query – Search in title or author_name
- Limit default Search query to post_title
- Get posts by similar names and categories
- Logging search queries for logged-in users
- How to show terms from another taxonomy
- Search Field that allows options of “Match any keyword” or “Match all keywords”
- Order & Orderby clause not working with custom query
- WordPress conflict with multiple load more posts functions on click
- How can I modify standard search query to include also ACF custom fields values?
- A very strange problem with search query
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- How to solve this script problem in theme directory?
- Search format not matching taxonomy query
- How to make the default WordPress search return borader results
- Search Functionality broken by the wp 4.2 update
- WordPress WP_Query offset parameter not working with search parameter
- Custom search (wp query by custom fields)
- WordPress WP_Query Array Custom search via taxonomies
- 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]
- Search Query that Includes Custom Table
- Sorting Posts Based On Meta Value Using AJAX
- Loop the posts between two dates selected using jquery datepicker
- Manipulating a query
- Query posts by custom fields
- Searching in specific custom post type
- Search (Custom Form, Custom Search Result)
- Stylesheet won’t load even when linked
- Help with showing text when something is entered in my search bar
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- Filtering product search results using tags
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- How does Show Posts based on a keyword search work in WP_Query
- Search query alteration not working for meta values
- Search results stuck on page 1
- AJAX search function resets wp_query vars
- WordPress Ajax search filter on dropdown select
- Custom Taxonomy in custom REST API search
- Advanced Search – Is this possible?
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string
- AJAX multiple search boxes not merging with array merge
- Removing filename searches when searching attachments