• I’m trying to create a function in functions.php to try and prevent tubepress from loading on any page except the “video” page.

    ` function remove_tubepress() {
    remove_action(‘wp_print_scripts’, ‘tubepress’);
    remove_action(‘wp_print_styles’, ‘tubepress’);

    }

    if( !is_page(‘video’) ) {
    add_action(‘wp_head’, ‘remove_tubepress’);
    }
    `

    And the code I think is used by the plugin in the plugin files is this one (may be wrong):

    ` public static function initAction()
    {
    /* no need to queue any of this stuff up in the admin section or login page */
    if (is_admin() || __FILE__ === ‘wp-login.php’) {
    return;
    }
    global $tubepress_base_url;

    wp_register_script(‘tubepress’, “$tubepress_base_url/sys/ui/static/js/tubepress.js”);
    wp_register_style(‘tubepress’, “$tubepress_base_url/sys/ui/themes/default/style.css”);

    wp_enqueue_script(‘jquery’);
    wp_enqueue_script(‘tubepress’);

    wp_enqueue_style(‘tubepress’);
    }
    `

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘trying to prevent tubepress from loading on the homepage’ is closed to new replies.