Support » Plugin: Infinite-Scroll » [Plugin: Infinite-Scroll] How to disable plugin on certain pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Was hoping this would help, but it hasn’t. Any ideas?

    /*  Remove Infinite Scroll javascript from every page except Frontpage
            ================================================================== */
            add_action( 'wp_print_scripts', 'deregister_infinite_scroll_javascript', 100 );
            function deregister_infinite_scroll_javascript() {
                if ( is_search() ) {
                    wp_deregister_script( 'infinite-scroll' );
                }
            }   
    
            /* Remove Easing Slider CSS from every page except Frontpage
            ================================================================== */
            add_action( 'wp_print_styles', 'deregister_infinite_scroll_styles', 100 );
            function deregister_infinite_scroll_styles() {
                if ( is_search() ) {
                    wp_deregister_style( 'infinite-scroll' );
                }
            }

    Getting closer! but not there yet.

    /*  Remove Infinite Scroll javascript Search page
            ================================================================== */
            add_action( 'wp_print_scripts', 'deregister_infinite_scroll_javascript', 100 );
            function deregister_infinite_scroll_javascript() {
                if ( is_search() ) {
                    wp_deregister_script( 'infinite-scroll-init' );
                }
            }   
    
            /* Remove Easing Slider CSS from Search page
            ================================================================== */
            add_action( 'wp_print_styles', 'deregister_infinite_scroll_styles', 100 );
            function deregister_infinite_scroll_styles() {
                if ( is_search() ) {
                    wp_deregister_style( 'infinite-scroll-init' );
                }
            }

    Getting warmer:
    This one removes the plugin from search, category pages and tag pages

    /*  Remove Infinite Scroll javascript from Search, Category, Tag Pages
            ================================================================== */
            add_action( 'wp_print_scripts', 'deregister_infinite_scroll_javascript', 100 );
            function deregister_infinite_scroll_javascript() {
                if ( is_search() || is_category() || is_tag()  ) {
                    wp_deregister_script( 'infinite-scroll-init' );
                    wp_deregister_script( 'infinite-scroll-admin' );
                }
            }   
    
            /* Remove Infinite Scroll CSS from Search, Category, Tag Pages
            ================================================================== */
            add_action( 'wp_print_styles', 'deregister_infinite_scroll_styles', 100 );
            function deregister_infinite_scroll_styles() {
                if ( is_search() || is_category() || is_tag()  ) {
                    wp_deregister_style( 'infinite-scroll-init' );
                    wp_deregister_style( 'infinite-scroll-admin-style' );
                }
            }

    I still see some inline CSS styling creeping in to the pages where I’ve deregistered the plugin. Anyone have any ideas how to stop this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Infinite-Scroll] How to disable plugin on certain pages?’ is closed to new replies.