How to add sliders to the page templates

As default sliders are available only on homepage templates. If you want to add sliders to the other page templates, you should do the following;

1) Go to Plugins->Editor

2) Select Sporty Flexslider plugin

3) Open “sporty-flexslider/sporty-flexslider.php” file

4) Find the following code;

function sporty_slider_scripts(){
    if ( is_page_template('homepage-full.php') || is_page_template('homepage-sidebar.php') ) { 
        wp_enqueue_style('sporty_flexslider_style', plugin_dir_url( __FILE__ ) . 'css/flexslider.css', true, '1.0');
        wp_register_script('sporty_flexslider',plugin_dir_url( __FILE__ ).'js/jquery.flexslider.js','','',true);
        wp_enqueue_script('sporty_flexslider');
    }
    if ( is_page_template('zeus-full.php') || is_page_template('zeus-sidebar.php') ) { 
        wp_enqueue_style('sporty_zeusslider_style', plugin_dir_url( __FILE__ ) . 'css/zeusslider.css', true, '1.0');
        wp_enqueue_style('sporty_zeusanimations_style', plugin_dir_url( __FILE__ ) . 'css/zeusanimations.css', true, '1.0');
        wp_register_script('sporty_zeusslider',plugin_dir_url( __FILE__ ).'js/zeusslider.js','','',true);
        wp_enqueue_script('sporty_zeusslider');
    }
}
add_action('wp_enqueue_scripts','sporty_slider_scripts');

5) Change it with the following (Be very careful and don’t change any other thing…) and click update file button;

function sporty_slider_scripts(){
        wp_enqueue_style('sporty_flexslider_style', plugin_dir_url( __FILE__ ) . 'css/flexslider.css', true, '1.0');
        wp_register_script('sporty_flexslider',plugin_dir_url( __FILE__ ).'js/jquery.flexslider.js','','',true);
        wp_enqueue_script('sporty_flexslider');
        wp_enqueue_style('sporty_zeusslider_style', plugin_dir_url( __FILE__ ) . 'css/zeusslider.css', true, '1.0');
        wp_enqueue_style('sporty_zeusanimations_style', plugin_dir_url( __FILE__ ) . 'css/zeusanimations.css', true, '1.0');
        wp_register_script('sporty_zeusslider',plugin_dir_url( __FILE__ ).'js/zeusslider.js','','',true);
        wp_enqueue_script('sporty_zeusslider');
}
add_action('wp_enqueue_scripts','sporty_slider_scripts');

Screenshot_3

Screenshot_4

6) Go to Appearance->Editor

7) Open a page template file which you want to add slider

8) Copy paste one of the following codes right before “PAGE CONTAINER” tag and click update file button

For the Flexslider

<?php 
if ( function_exists( 'sporty_flexslider_template' ) ) {
    sporty_flexslider_template(); 
}
?>

For the zeusslider

<?php 
if ( function_exists( 'sporty_zeusslider_template' ) ) {
    sporty_zeusslider_template(); 
}
?>

Screenshot_1

Screenshot_2