WordPress.org

Ready to get started?Download WordPress

Forums

TubePress
trying to prevent tubepress from loading on the homepage (2 posts)

  1. xorred
    Member
    Posted 3 years ago #

    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');
    }
    `

  2. Daniel Nielsen
    Member
    Posted 2 years ago #

    Did you get this to work? Looking for the same solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags