Title: Replacing results div
Last modified: April 5, 2022

---

# Replacing results div

 *  Resolved [annettepixie](https://wordpress.org/support/users/annettepixie/)
 * (@annettepixie)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/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)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/replacing-results-div/#post-15528269)
 * Move your filter later in the hook, it’s probably now running before the default
   hook in Live Ajax Search:
 * `add_filter( 'get_search_form', 'prepare_search_form', 11 );`
 *  Thread Starter [annettepixie](https://wordpress.org/support/users/annettepixie/)
 * (@annettepixie)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/replacing-results-div/#post-15528433)
 * Thank you so much for getting back so quickly!
 * I tried setting the priorty to 11 and also 99 but actually turns out I should
   have also used the relevanssi_live_search_add_result_div filter and returned 
   false. Now works even with priorty of 10.
 * Only issue is the positioning is being set on the child div class relevanssi-
   live-search-results, so I’m back to square one. However, I see from [script.js](https://github.com/msaari/relevanssi-live-ajax-search/blob/36a75241358deda6e618833bb7490d4d7a7fc645/assets/javascript/src/script.js)
   that positioning isn’t set if the input field is hidden and as I want it initially
   hidden, hopefully that will sort out my issue.
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/replacing-results-div/#post-15530877)
 * I’ll mark this thread resolved; if further problems crop up, feel free to start
   a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Replacing results div’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi-live-ajax-search/assets/icon-256x256.png?rev=
   3529563)
 * [Relevanssi Live Ajax Search](https://wordpress.org/plugins/relevanssi-live-ajax-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi-live-ajax-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi-live-ajax-search/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi-live-ajax-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi-live-ajax-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi-live-ajax-search/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/replacing-results-div/#post-15530877)
 * Status: resolved