Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Konstantinos Kouratoras

    (@kouratoras)

    Hi!

    You can use the Conditional Tags of WordPress and exclude the pages you want.

    When you find the conditional tag that fits you, edit the file /wp-content/plugins/smooth-scroll-up/plugin.php you can edit the plugin_js() function and add your conditions in the if statement.

    But have in mind, that any changes will be lost if you update the plugin in the future.

    Thread Starter MPthewho

    (@mpthewho)

    Would it be ok to put conditional tags in my child theme functions.php file?

    For example: I want to disable Smooth scroll up on a page called “Register”.
    Is there any way to achieve that with extra code in functions.php?

    I found a similar solution on a web – but I think it will disable the plugin on all pages, except one.

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    function my_deregister_javascript() {
    if ( !is_page('Register') ) {
    wp_deregister_script( 'scrollup-js' );
    }
    }

    Thank you for your help! You made an excelent plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to disable plugin on specific pages?’ is closed to new replies.