• Resolved noearthling

    (@noearthling)


    Hi,
    I use the Catchbox theme and like it very much. But as I do not use the slider I would like to remove it completely from my website.

    The problem is, that even though I have disabled the slider and it will not show anymore, all its related files and functions are still loaded and slowing down the overall performance.

    Is there any help? For example just by removing the slider.js-file? Or do I have to insert a certain code in the function.php?

    I’d really appreciate your help here. Thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Catch Themes

    (@catchthemes)

    @noearthling: It’s pretty simple.
    Go to Theme Options -> Featured Slider -> Slider Options.
    Then in number of slides. Type in 0. This will remove all the ids in the slider and then if the slider doesn’t find any ids it will simply be disabled.

    Thread Starter noearthling

    (@noearthling)

    Hi Sakin,
    thank you very much for your answer, but I already did what you said. I disabled the slider by setting the number of slides to 0, so the slider won’t show anymore. But the files, e.g. slider.js, are still loaded slowing down the performance. I would like to remove this file from the theme completely without destroying the theme.

    Do you have any suggestions how to do that?

    Thanks in advance.

    Theme Author Catch Themes

    (@catchthemes)

    @noearthling: in theme fucntion.php you will see the below code:

    /**
     * Register jquery scripts
     *
     * @register jquery cycle and custom-script
     * hooks action wp_enqueue_scripts
     */
    function catchbox_scripts_method() {
    	//Register JQuery circle all and JQuery set up as dependent on Jquery-cycle
    	wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true );
    
    	//Enqueue Slider Script only in Front Page
    	if(is_home() || is_front_page()) {
    		wp_enqueue_script( 'catchbox_slider', get_template_directory_uri() . '/js/catchbox_slider.js', array( 'jquery-cycle' ), '1.0', true );
    	}
    
    	wp_enqueue_script('catchbox-menu', get_template_directory_uri() . '/js/catchbox-menu.min.js', array('jquery'), '1.1.0', true);
    
    	//Browser Specific Enqueue Script i.e. for IE 1-6
    	$catchbox_ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    	if(preg_match('/(?i)msie [1-6]/',$catchbox_ua)) {
    		wp_enqueue_script( 'catchbox-pngfix', get_template_directory_uri() . '/js/pngfix.min.js' );
    	}
    	//browser specific queuing i.e. for IE 1-8
    	if(preg_match('/(?i)msie [1-8]/',$catchbox_ua)) {
    	 	wp_enqueue_script( 'catchbox-html5', get_template_directory_uri() . '/js/html5.js' );
    	}
    
    } // catchbox_scripts_method

    Replace this with the following:

    /**
     * Register jquery scripts
     *
     * @register jquery cycle and custom-script
     * hooks action wp_enqueue_scripts
     */
    function catchbox_scripts_method() {
    	/*
    	//Register JQuery circle all and JQuery set up as dependent on Jquery-cycle
    	wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true );
    
    	//Enqueue Slider Script only in Front Page
    	if(is_home() || is_front_page()) {
    		wp_enqueue_script( 'catchbox_slider', get_template_directory_uri() . '/js/catchbox_slider.js', array( 'jquery-cycle' ), '1.0', true );
    	}
    	*/
    
    	wp_enqueue_script('catchbox-menu', get_template_directory_uri() . '/js/catchbox-menu.min.js', array('jquery'), '1.1.0', true);
    
    	//Browser Specific Enqueue Script i.e. for IE 1-6
    	$catchbox_ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    	if(preg_match('/(?i)msie [1-6]/',$catchbox_ua)) {
    		wp_enqueue_script( 'catchbox-pngfix', get_template_directory_uri() . '/js/pngfix.min.js' );
    	}
    	//browser specific queuing i.e. for IE 1-8
    	if(preg_match('/(?i)msie [1-8]/',$catchbox_ua)) {
    	 	wp_enqueue_script( 'catchbox-html5', get_template_directory_uri() . '/js/html5.js' );
    	}
    
    } // catchbox_scripts_method

    Thread Starter noearthling

    (@noearthling)

    Hi Sakin,

    that helped!

    I removed the part you marked as “comment” from the file altogether and it doesn’t seem to have any negative effects so far. If you do have any concerns about this, please let me know.

    Thanks again for your help.

    Theme Author Catch Themes

    (@catchthemes)

    @noearthling: just remember this setting if you have done edits in you core theme file. So, whenever there is update. You can just do it..

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove slider.js completely’ is closed to new replies.