How to add revolution slider to posts and catgories

Hi,

I’m trying to add revolution slider to my posts and categories, but I’m obviously doing something wrong. I tried adding code to the functions.php, which resulted in a 500 error.

I’m currently running x pro child theme with the ethos stack.

Thanks.

Hi There,

You can try with this code instead:

add_action( 'x_after_view_global__navbar', 'x_print_top_slider' );
function x_print_top_slider(){
  if( is_singular('post') || is_category() ){
    echo do_shortcode( '[rev_slider alias="home1"]' );
  }
}

Don’t forget to replace the slider shortcode.

Hope it helps :slight_smile:

Thanks. And this should go into the functions.php file?

I tried adding this to my functions.php file and it’s still not working.

Hi,

Please make sure to replace [rev_slider alias="home1"] with your own slider shortcode.

You can find it here

Make sure to add the code provided after this line in your child theme’s functions.php file

// Additional Functions
// =============================================================================

Thanks

I’ve double checked both of your suggestions. Everything is entered in correctly. It’s still not working.

Hey There,

Would you mind providing us with login credentials so we can take a closer look? Please provide following information:

Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

All the best!

Hi,

The code didn’t work because you are using PRO Headers.

To make it work, you can change the code to this.

add_action( 'x_after_view_global__slider-below', 'x_print_top_slider' );
function x_print_top_slider(){
  if( is_singular('post') || is_category() ){
    echo do_shortcode( '[rev_slider alias="Content_Page"]' );
  }
}

or if you want it on top you can change it to this.

add_action( 'x_after_view_global__slider-above', 'x_print_top_slider' );
function x_print_top_slider(){
  if( is_singular('post') || is_category() ){
    echo do_shortcode( '[rev_slider alias="Content_Page"]' );
  }
}

Hope this helps

That worked perfectly. Thanks.

Another question, is there a way to age a page title and breadcrumbs to category pages?

Hi there,

I did not understand your question unfortunately.

Kindly open up new threads for additional questions as it will help us to focus on each issue and give you a better support which you deserve. Having a long threads makes the maintaining job harder and also it will be harder for the other customers to find the correct information if they have similar issues. You are always welcomed to reply to this thread to follow up the same question.

Thank you.

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