Ah, I see. The problem is this: Live Ajax Search uses jQuery("#s").offset()
to get the location of the search input field to place the results just below it.
When the page is scrolled to the top, this returns {top: 23.8515625, left: 1201.5078125}
, which is the right spot.
When I scroll down and run jQuery("#s").offset()
again, the top
value changes. So, for some reason, offset()
believes the header isn’t fixed on top of the document but instead scrolls down the page.
The good news is: I found a solution for this. It requires an update to the plugin, but once I release the next version, all you need to do is to add this to your theme functions.php or in a code snippet:
add_filter( 'relevanssi_live_search_configs', function( $configs ) {
$configs['default']['results']['static_offset'] = false;
return $configs;
} );
This will make Live Ajax Search calculate the offset differently, which should work with your header.