php – How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
I take the question back with context.
The goal is not to add posts or pages so that the post is replaced by the title of the post/page.
The goal is not to modify the search.php file to remove this error message by hand.
Imagine the situation. We have a normal page with a search widget in a sidebar or in the footer. If you launch the search, you will have your site loading due to the widget submit. WordPress will search for search.php but since I have 0 articles on my site it will display the title of this topic. I want to delete this message no matter what theme a user selects. If I manage to remove this message, I will be able to use my second widget which will take care of the particular display, but I need to remove the message first.
I can’t use AJAX because I will lose the URL change when searching.
I can’t use style classes because each theme has its own style.
Is there any way to remove this message despite these conditions?
Leave an answer