Adding revolution Slider header to blog category page

HI, i had done this before but i added the same code as before to the child theme and its not seeming to work. Nothing is showing up
I’m just trying to add a banner to the news category of my blog.
i used this

function add_my_slider() {
if(is_category( ‘31’ )) {
echo do_shortcode(’[rev_slider alias=“news-slider”]’);
}
}

add_action( ‘action_name’, ‘add_my_slider’, 5 );

Also how can I make the revolution slider on that page be the same size on my top banner on another page

I want to have news header/slider be the same size as the top banner i have on my contact page.

thanks

Hi @designbabe,

I changed the code in the Child Theme to:


function custom_slider() { 
  if ( is_category( '3' ) ) : ?>
   <div class="custom-slider">
     <?php echo do_shortcode( '[rev_slider alias="news-slider"]' ); ?>
   </div>
   <?php endif; 
 }
 add_action('x_after_view_global__slider-below','custom_slider', 10);

The category ID was 3 and the action name was wrong it should be x_after_view_global__slider-below.

The height of the slider is something that you need to set in the slider itself. Here is a good resource that you can start with:

Thank you.

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