Title: Conditional loading by page
Last modified: September 1, 2016

---

# Conditional loading by page

 *  [dhinz](https://wordpress.org/support/users/dhinz/)
 * (@dhinz)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/conditional-loading-by-page/)
 * I only use text slider on my home page.
    I’d like to prevent it from loading 
   all of it’s files on every page on the site so was thinking of something like
   this in my custom.php file
 * can you tell me the correct name for the ‘text_slider’ below
    as well as what
   I should use to stop the css loads too?
 *     ```
       function custom_text_slider_load() {
           if( is_home() ) {
               text_slider();
           }
       }
   
       remove_action( 'wp_enqueue_scripts', 'text_slider' );
       add_action( 'wp_enqueue_scripts', 'custom_text_slider_load' );
       ```
   
 * Thanks!
 * [https://wordpress.org/plugins/text-slider/](https://wordpress.org/plugins/text-slider/)

The topic ‘Conditional loading by page’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/text-slider_6ebaa9.svg)
 * [Text Slider](https://wordpress.org/plugins/text-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/text-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/text-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/text-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/text-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/text-slider/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [dhinz](https://wordpress.org/support/users/dhinz/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/conditional-loading-by-page/)
 * Status: not resolved