Replacing results div
-
Hi,
I have this working on the default settings but I’m trying to replace the results div as I need to position the search form.
I’ve tried to use the wp get_search_form filter to provide the new div id and data-rlvparentel attribute value.
add_filter( 'get_search_form', 'prepare_search_form' ); function prepare_search_form( $form ){ $form = ' <form role="search" method="get" class="search-form" action="/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search …" name="s" data-rlvlive="true" data-rlvparentel="#ep-rlvlive" data-rlvconfig="default"> </label> <input type="submit" class="search-submit" value="Search"> <div id="ep-rlvlive"></div> </form>'; return $form; }
My new div is getting added but is ignored as the data-rlvparentel is being reset to the default and the default results div is also being rendered.
<form role="search" method="get" class="search-form" action="/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search …" name="s" data-rlvlive="true" data-rlvparentel="#rlvlive_1" data-rlvconfig="default" autocomplete="off" aria-owns="relevanssi_live_search_results_624c1e0be9b67" aria-autocomplete="both" aria-label="When autocomplete results are available use up and down arrows to review and enter to go to the desired page. Touch device users, explore by touch or with swipe gestures."> </label> <input type="submit" class="search-submit" value="Search"> <div id="ep-rlvlive"></div> <div id="rlvlive_1"></div> </form>
FYI I’m using Oxygen Builder which disables themes.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Replacing results div’ is closed to new replies.