Hey Mike and welcome to the WordPress Stack Exchange!
First, it’s good form to always include the code you use (or a link to where you found it) if you mention it in your post.
This error comes up when you use it prior to the search being run. The WordPress Codex doesn’t have a ton of detail, but the basic gist is this: the function is very light weight and only returns a boolean. The reason it must be after the query is because it will always return false as it is checking wp_query() which doesn’t exist until a query is run.
Unless your installation is aged and was recently updated, this error has probably been there for a while.
If the site is functioning the way you want, you can find the offending code and remove it since it’s not in the right place anyways.
Related Posts:
- what are the numbers between curly brackets in search query
- Search custom post type by meta data
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- search through post-type attachments titles
- Change searched term
- Search query -> Show all pages except certain template
- Temporarily storing main search result
- Query based on title, with ‘compare’ => ‘IN’
- Attempt to improve WP search, can someone check my SQL query?
- Searching With Apostrophe
- How to reset usual $query on search page to push custom $wpdb query there?
- Ideas how to search & replace post_content when string contains a newline?
- How to insert Collate into WordPress search query?
- Slow Search Queries – How to exclude pages, media, excerpt, authors, private posts?
- How to interfere to default search to make it search in custom fields?
- How to manage a particular “order by” for get_search_query()?
- WordPress search in modified post title
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- Add rewrite rule for archive search
- Restrict WordPress search to a single ACF field
- Modify behaviour of “s” parameter in wp_query
- Sort by postmeta on when searching
- Pagination adds search query (again)
- Speed up search query that searches in post meta?
- How to make MySQL search queries with quotes
- $query->set( ‘post_type’, ‘post’ ); not working
- search.php is not generating the right results
- Run search query again without pagination gives no results?
- How to Optimize WP site for millions of posts
- Get Terms by IDs with IDs order
- How many WordPress SQL Queries per page?
- Slow wp_enqueue_media()
- Advanced Custom Fields – Query Efficiency
- How to display lastest post date in the homepage?
- How to tell if $query_var isset?
- Custom search page and search by title, content and tag
- Sorting Grids with Essential Grid and Events Manger
- The use of including upgrade.php when building custom queries
- Get the timout value of a saved transient?
- Taxonomy.php issue with search and filters
- Slow meta_query with about 4 milion record on wp_postmeta
- WordPress Find Duplicate Post By Content
- WP Query Sort by meta value (date)
- mySQL query. ORDER BY meta_key
- how to query multiple categories in wordpress?
- Disable the MySQL query in the main query
- Strange string in console from wpdb query
- Update slug (URL) of pending posts via phpMyAdmin
- How can I get the query that would be run for the archive page?
- Creating a custom search for a specific post type
- Query metas (and not : query posts by metas)
- Select query for a login
- What’s wrong with my $wpdb prepare?
- get_the_category and echo out link to child-most/deepest category
- where should I reset query after using get_results?
- Exclude featured image and custom field from this get_attachment query
- wpdb print all post meta
- Create Indexes for Slow Queries
- Query to get number of posts last week
- I want to create a filter for the query string is this possible?
- Exclude categories from the_category();
- How can i show all categories using wp query?
- WooCommerce search products between price range using WP_Query
- All in One Calendar Plugin Custom Post Type Query [closed]
- Get Posts from Last 24 hours and Sort them via GD Star Rating
- Query returning same results even though the ID changes
- Why my query ‘REPLACE INTO…’ does not work?
- Restrict query to last day with posts
- Custom query object with Simple-Fields custom date field
- How to read the value of a WordPress $query associative array (hash) key
- Query posts based on previous query
- Waypoints + infinite scroll with custom query
- Customizing the_tags output?
- Filtering custom posts by custom fields (ACF) [closed]
- Querying with WP query using meta key price
- Re-sort get_posts query results
- How do I get all results from my query
- Taxonomy filter under Polylang
- create a link to a random post within the current category
- Pagination not working on custom post types with rewrite slug
- Change pure SQL database query to WordPress post query?
- Search & column order by meta value in admin
- Pulling an ACF into a query
- How can I modify standard search query to include also ACF custom fields values?
- Using cron for multiple queries
- Need help setting up a search form for wordpress [duplicate]
- Custom Query problem access the values
- Set posts per page for parent category and it’s all children
- Exclude sticky posts from query
- If more than 1 image show post link?
- Rewrite Query_Var URL Parameter with Slug
- How to query different categories on index?
- How to specify what kind of is_single post?
- Can’t See Media Queries with Inspect Tool [closed]
- Print data from wordpress sql query
- Can I create my own query in wordpress with traditional methods?
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Advanced Search – Is this possible?
- How to show sticky posts on all pages of the pagination, not just the first page?