Multisite Site Search results Display Issue

Site Search page is displaying the text of a page first and then a listing below. Is there any way to just show the listings below?
I cannot figure out why it would display the text of a page/post first and then other search results.

  • Ash

    Hello kennibc

    I have checked the same in my test site and it worked fine. And then, I have tried with Divi theme and still it worked. So, it seems there is a specific configuration of the theme, that is creating the issue.

    I have a quick hack you may like to implement.

    add_action( 'wp_head', function() {
    	if( isset( $_REQUEST['phrase'] ) && $_REQUEST['phrase'] != '' ) {
    	?>
    	<script type="text/javascript">
    		jQuery(function($){
    			$( ".entry-content form" ).prevAll().remove();
    		});
    	</script>
    	<?php
    	}
    } );

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.