Redirecting wordpress search query to archive page

Simply make an HTML form in Elementor on the archive page where you want to search.

Code:

<form class="zohaib-search-form" role="search" action="/courses" method="get">
<input placeholder="Search.." name="s" type="search">
<button type="submit"><i class="fas fa-search"></i></button>

**Note:** name property of input should be ‘s’ because the search query is looking for key ‘s’ to get and run it.

Replace the action property with your custom post type. It will only work if the action link will be an archive page. After submit the search the filter result will also show on the same archive page like mine courses archive page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)