Slider Below Masthead On Search Results Page

How can I set a specific slider below the masthead on the seach results page when using the Integrity stack?

Hello There,

Thanks for posting in!

Please be aware that you can only assign a header in the pages. Blog index, category pages, archive pages and search results pages does not have this option and there is nowhere you can assign a slide to these pages. It can be done with a little help by adding a snippet in your child theme’s functions.php file. Assuming that you already have a child theme, please add the following code in your child theme’s functions.php file

// Add a custom slider to search pages
// =============================================================================
function custom_slider() { ?>

  <?php if( is_search() ) : ?>
 
    <div class="x-container custom-slider" style="clear: both;">
      <?php echo do_shortcode('[rev_slider alias="name"]'); ?>
    </div>
 
  <?php endif; 
}
add_action('add_action('x_after_view_global__slider-below','custom_slider', 30);
// =============================================================================

Please make sure to insert the correct slider shortcode. I used [rev_slider alias="name"] as an example.

Hope this helps.

Thanks RueNel ! It looks like a syntax error has crept in on line 38. I tried a few things but haven’t managed to get it working. See screenshots below :

No worries I got it working :wink:

Thank you so much for your help.

You’re welcome. Glad you’ve sorted it out.

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