Woo commerce page - add slider on top of content?

Hello,

I would also to add a shortcode to display a slider on my homepage (which is the woo commerce main product page) - but I cannot find the right place to add the shortcode … ?

links in private

Cheers

Hi,

To achieve that, you can add this in your child theme’s functions.php file.

function add_slider() {
if(is_front_page() || is_singular('post')){
  echo do_shortcode('[layerslider id="2"]');
}
}

add_action( 'x_after_site_begin', 'add_slider', 10 );

Hope that helps.

well - thanks a lot - but it did partially work. the slideshow is not under the top bar - it took also ages to download (maybe because of my images sizes). I set a page with it on our site so you can check (see the private message) thanks

Cheers

Please - can you have a look - I need to go live with this function today. Thanks a lot for your understanding :slight_smile:

Hello There,

Thanks for updating in! Just for future topics, self responding or bumping your post pushes it back in our Queue system so it takes longer to respond to.

To move your slider under the topbar, please make use of this code instead:

function add_slider() {
  if(is_front_page() || is_singular('post')){
    echo do_shortcode('[layerslider id="2"]');
  }
}
add_action( 'x_after_masthead_end', 'add_slider', 10 );

We would loved to know if this has work for you. Thank you.

yep - thank you very much, it worked :slight_smile: Best regards,

You’re welcome.

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