How to add banner (example)

Hey there!

I’m looking to add custom banner on a products page. I’ll provide a picture below. Also, if I don’t plan on doing that, how do I center align the text “recommended skate shoes”?

Thank you!

Hi Theodore,

To center the product title, please add this custom CSS:

h1.h-landmark.entry-title {
    text-align: center;
}

To add a banner to single product page, please add the following code under functions.php file locates in your child theme:

add_action( 'x_before_view_ethos__landmark-header', 'print_product_banner' );
function print_product_banner(){
	if(x_is_product()){
	?>
	<a href="#"><img src="http://via.placeholder.com/350x150" /></a>
	<?php
	}
}

Hope it helps :slight_smile:

You’re the best, thank you very much!

You’re most welcome!

So I can’t seem to get this to work. In my bluehost I go to file manager, access functions.php.
Do I upload banner in the php section or somewhere else?

like this?

Hi Theodore,

Thanks for reaching out.

Seems the landmark is inactive, instead, please replace this line from that code

add_action( 'x_before_view_ethos__landmark-header', 'print_product_banner' );

with this

add_action( 'x_before_view_global__navbar', 'print_product_banner' );

Thanks!

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