Display search results in the current page
-
Hello,
When I research something with the WordPress search system, I’m redirected at the page search.php where the search results are displayed.
I would like to not be redirected and have the results displayed in the current page.
I use Avada theme (I know a theme limit a lot what we can do but I havn’t the choice…).Here is the code of the searchform :
<form role="search" class="searchform" method="get" action="<?php echo esc_url_raw( home_url( '/' ) ); ?>"> <div class="search-table"> <div class="search-field"> <input type="text" value="" name="s" class="s" placeholder="<?php esc_html_e( 'Search ...', 'Avada' ); ?>" required aria-required="true" aria-label="<?php esc_html_e( 'Search ...', 'Avada' ); ?>"/> </div> <div class="search-button"> <input type="submit" class="searchsubmit" value="" /> </div> </div> </form>
I already try to change
action="<?php echo esc_url_raw( home_url( '/' ) ); ?>"
byaction="<?php echo get_permalink(); ?>
, but it only redirect me on the page 404.php.I think there is a loop somewhere I have to modify, but I don’t know in which file.
Moreover I wan’t to use Relevanssi plug-in, and I’m affraid that too much modification in the code of the search system will cause a problem for the right functionning of the plug-in. Is that the case ?
Thank you very much for the help you can provide me (and sorry for my approximate english),
Morgane
- The topic ‘Display search results in the current page’ is closed to new replies.