Adding Title To Search Results Page

Hello support team,

I would like to add a title, “Search Results” in the tip middle of the search results page.

I assume I need to use a child theme here.

I am not sure what file to change and how to implement code to add this title

Help would be appreciated!

Thanks

Hi There,

To achieve that, please add the following code under functions.php locates in your child theme:

add_action( 'x_before_view_global__index', 'print_custom_header' );
function print_custom_header(){
	if( is_search() ){
		?>
		<div id="blog_section" class="x-section" style="margin: 0px;padding: 45px 0px; background-color: transparent; text-align: center;">
			<div class="x-container max width" style="margin: 0px auto;padding: 0px;">
				<div class="x-column x-sm x-1-1" style="padding: 0px;">
					<h1>Search Results</h1>
				</div>
			</div>
		</div>
		<?php
	}
}

Hope it helps :slight_smile:

Great! Thanks for the help @thai

The code has worked!

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.