Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1109155
    MaceInyerFace
    Participant

    Hi ~

    I’d like to add a LayerSlider to each of the woocommerce pages. I understand there is not a way to do this with Cornerstone, but is there a css solution to add this element under the masthead?

    If you visit the site below, you’ll see that the layerslider is lost on all the Woocommerce related pages:

    http://beta.strategicpreventionsolutions.com

    Thanks,

    #1109444
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Could you please provide sample page URLs where you expect to add LayerSlider, so that we should be able to assist you with a custom workaround.

    Thanks!

    #1109463
    MaceInyerFace
    Participant
    #1109746
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! To resolve this issue, since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Add custom layerslider below the masthead
    // =============================================================================
    function custom_slider_below_masthead() { ?>
      <?php if ( is_shop() || is_cart() ) : ?>
        <div class="custom-slider">
          <?php echo do_shortcode('[layerslider id="1"]'); ?>
        </div>
      <?php endif; ?>
    <?php }
    add_action('x_after_view_global__slider-below', 'custom_slider_below_masthead');
    // =============================================================================

    Please supply the correct layerslider shortcode.

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

    #1110325
    MaceInyerFace
    Participant

    Hi ~

    Yes!

    Perfect. I also needed it on the checkout page, but that was fairly easy to add in based on your provided code.

    // Add custom layerslider below the masthead
    // =============================================================================
    function custom_slider_below_masthead() { ?>
    <?php if ( is_shop() || is_cart() || is_checkout() ) : ?>
    <div class=”custom-slider”>
    <?php echo do_shortcode(‘[layerslider id=”1″]’); ?>
    </div>
    <?php endif; ?>
    <?php }
    add_action(‘x_after_view_global__slider-below’, ‘custom_slider_below_masthead’);
    // =============================================================================

    Thanks so much,

    #1110400
    MaceInyerFace
    Participant

    In case anyone runs into this same problem, I also ended up needing it to display on the individual product pages – which was an other easy addition to the above code:

    // =============================================================================
    function custom_slider_below_masthead() { ?>
    <?php if ( is_shop() || is_cart() || is_checkout() || is_product() ) : ?>
    <div class=”custom-slider”>
    <?php echo do_shortcode(‘[layerslider id=”1″]’); ?>
    </div>
    <?php endif; ?>
    <?php }
    add_action(‘x_after_view_global__slider-below’, ‘custom_slider_below_masthead’);
    // =============================================================================

    #1110593
    Rue Nel
    Moderator

    Hey There,

    You’re welcome! We are just glad we were able to help you out.
    Thanks for letting us know that it has worked for you.

    If you need anything else we can help you with, don’t hesitate to open another thread.

    Cheers.

  • <script> jQuery(function($){ $("#no-reply-1109155 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>