How can I display the search results on the same page where I have put search form?
1 Answer
Can you explain how did you put the search form? Are you working in code or with any page builders?
Assuming you are using code, best case is to use Javascript / Ajax to search in the same page.
Other options include submitting the search form and reloading the page with data. You can add form submit action like this to submit your search form to the same page.
<form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
// your search input here
</form>
Then in the same page, you catch the form submission like this and show the results.
if ($_SERVER['REQUEST_METHOD'] === 'POST'){
enter code here
}