Slider on all pages for Sparkling WordPress theme

Hello and thank you very much for this amazing theme. I would like to add the slider to all blog pages (only pages, not posts, archives etc)… I tried to add the conditional tag is_page() in functions.php on these lines…


 // Add slider CSS only if is front page ans slider is enabled
  if( ( is_home() || is_front_page() ) && of_get_option('sparkling_slider_checkbox') == 1 ) {
		wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
  }

  // Add slider JS only if is front page ans slider is enabled
	if( ( is_home() || is_front_page() ) && of_get_option('sparkling_slider_checkbox') == 1 ) {
		wp_enqueue_script( 'flexslider-js', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '20140222', true );
	}

  // Flexslider customization
  if( ( is_home() || is_front_page() ) && of_get_option('sparkling_slider_checkbox') == 1 ) {
    wp_enqueue_script( 'flexslider-customization', get_template_directory_uri() . '/inc/js/flexslider-custom.js', array('jquery', 'flexslider-js'), '20140716', true );
  }

… but it doesn’t seems to work, even if I add is_page() the slider only appears in index

Any help is appreciated. Thank you.

If you edit above mentioned code it will print slider related CSS and JavaScript on all pages but slider will not appear because you also need to do the same thing with slider function itself.

You should edit file called extras.php that you can find in sparkling folder >> inc.

Now find a functions:

sparkling_featured_slider

And do the same modifications you did with JavaScript and CSS by adding is_page conditional tag.

Let me know if this helps.

Thank you Aigars, works like a charm. Keep up with the great work.