Banner / Slider in Category Pages

Hi, is there a way with X-Theme to put a banner or a slider on top of a product category page? I’m relatively new to Wordpress and couldn’t figure out how to accomplish that.

Thanks

This is an automated message to notify you that your thread was posted in the wrong forum, and it has been moved to the correct place. A member of our team will be happy to reply just as soon as your thread is up. How support works.

For support, please post all questions in the Support Forum.

For peer to peer conversations with other Themeco customers about tips, customizations, or suggestions you are welcome to use the Peer to Peer (no official support provided here).

For Design & Development, Marketing & Media, and Hosting & Optimization discussions you are welcome to use the General Forum to discuss with fellow Apex members about non Themeco related topics. Please keep this in mind in the future.

Thank-you!

Hi There,

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

  • Slider:
add_action( 'woocommerce_before_shop_loop', 'print_product_cat_slider' );
function print_product_cat_slider(){
	if(x_is_product_category()){
		echo do_shortcode( '[your-slider-shortcode]' );
	}
}
  • Banner:
add_action( 'woocommerce_before_shop_loop', 'print_product_cat_slider' );
function print_product_cat_slider(){
	if(x_is_product_category()){
	?>
	<a href="#"><img src="http://via.placeholder.com/350x150" /></a>
	<?php
	}
}

Let us know how it goes!

Thanks Thai, it works…but what if I’d like to have the banner as a background for the Category Title instead ? Furthermore, if that is possibile… how could I handle specific images for Categories ?

Hi there,

Thanks for writing in! Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

Thanks for understanding. Take care!

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