Adding Slider on All Pages

I’m currently trying to get the slider on all pages and it’s not working properly on the other pages but the front page. It just shows the featured images with captions. It appears that the Javascript is not on the other pages (educated guess). Please help! It would be greatly appreciated!

I’m running this theme locally, so unfortunately I don’t have a link to show.

This is not possible via Theme Options or WordPress dashboard but it is fairly easy to get done.

First of all you should replace this code in functions.php:

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' );
  }

With:

wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );

On the same file replace this code:

	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 );
  }

With:

wp_enqueue_script( 'flexslider-js', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '20140222', true );

wp_enqueue_script( 'flexslider-customization', get_template_directory_uri() . '/inc/js/flexslider-custom.js', array('jquery', 'flexslider-js'), '20140716', true );

When you are done with this open extras.php file and remove

is_front_page() &&

from function called sparkling_featured_slider

Now you will get slider working on all posts/pages without any exceptions.

You are a genius! :slight_smile:
Thank you so very much for helping me!!!

I’ve got the same problem and did the steps as described before. After I changed the extra.php file and try to upload it again I always get this information:
“Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”

I already tried it another day, but nothing changed. What did I wrong? What do I have to do to solve the problem?
My website is atlantic-lodge.com

Thanks for helping me!
Britta

Hi,

has anybody any suggestion? I tried it again and I got the same answer;-(

Thanks in advance!
Britta

I complete the edits to the files as specified. I am not sure how to now add the slider to the home page. See www.qabrar.org

Hi @nigerhall,

You will find information on the following page in the section “Set up Homepage Featured Slider” about how to add the slider to the home page.

This is old thread and to help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Cheers,
Movin

Just updating this topic that this can be achieved using the custom child theme of Sparkling theme attached to the following reply that contains some custom code.

https://colorlibsupport.com/t/slider-on-every-pages/#post-47733