Insert an image banner as a header

Hello,

I’m trying to insert an image just below the nav bar, like an header but I cannot manage to find if it’s an option of the theme. I’m using the Stack renew. I discover how to put a backgroung image, but it’s not what i want. i would like just an image banner on the top of the website like on this website : http://massage-sensitif.net/

If someone has an idea : should I change the stack ? Use CSS code ?

Thanks in advance

Hi There,

You have to setup a child theme first: https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57

After that adding this custom code under functions.php file locates in that child theme directory:

add_action( 'x_after_view_global__navbar', 'x_print_top_slider' );
function x_print_top_slider(){
	?>
	<div class="my-banner">
		<img src="//massage-sensitif.net/wp-content/uploads/2018/04/cropped-For%C3%AAt_Alexane-1-1.jpg">
	</div>
	<?php
}

Let us know how it goes!

1 Like

Hi !

Thanks for the tip. I’m going to try this and come back to you.

Have a nice day !

You’re most welcome! Sure, please try it first :slight_smile:

1 Like

Hello !

As promised I come back to you. Thanks a lot, this code works very well.

To adapt the size of the pic in high, better to upload a shorter image processed in a software or to implement the code yous ent me ?

Thanks a lot again. Fast and efficient reply !

Hello @Henni

I recommend cropping the image in the size you want in any image editor then upload it to your website and use it like that.

Thanks.

1 Like

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