WordPress.org

Forums

KingSize Theme and vSlider jQuery Conflict (5 posts)

  1. ratputin
    Member
    Posted 3 years ago #

    WordPress v.3.2.1
    vSlider v4.1
    Theme: KingSize (ref: http://themeforest.net/item/king-size-fullscreen-background-template-/148767)
    URL" http://www.ryanrobertsonracing.com/New-Site/ryan-robertson/

    I am attempting to use vSlider as a widget in a build using the KingSize Theme. vSlider is not rotating. I have tested it in the same build using the TwentyTen Theme and it works correctly.

    After activating the plugin, I am seeing this error:
    Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function

    After some more trouble shooting and Googling, I believe the issue lies in the line wp_deregister_script( 'jquery' ); in the themes function.php code below...

    <!---------------START---------------->
    function my_init_method() {
    if (!is_admin()) {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    wp_register_script("cufon", get_bloginfo(template_directory) . "/js/cufon-yui.js");
    wp_enqueue_script('cufon');
    wp_register_script('PT_Sans', get_bloginfo(template_directory) . "/js/PT_Sans.font.js");
    wp_enqueue_script('PT_Sans');
    wp_register_script('PT_Sans_Narrow', get_bloginfo(template_directory) . "/js/PT_Sans_Narrow.font.js");
    wp_enqueue_script('PT_Sans_Narrow');
    wp_register_script('custom', get_bloginfo(template_directory) . "/js/custom.js");
    wp_enqueue_script('custom');
    wp_register_script('tipsy', get_bloginfo(template_directory) . "/js/jquery.tipsy.js");
    wp_enqueue_script('tipsy');
    }
    }
    add_action('init', 'my_init_method');
    <!--------------------END----------------->

    Whenever I delete that line, vSlider works, but of course it causes problems with the theme. It may have something to do with both calling to the default jQuery shortcut of $...but I am no expert in this, so that is only a guess.

    Any ideas on a work around?
    TIA
    Kevin

  2. Josh
    Member
    Posted 3 years ago #

    I recommend contacting the author for support: support (AT) kingsizetheme.com

  3. Mark / t31os
    Moderator
    Posted 3 years ago #

    Whilst you're there let the author know he shouldn't be enqueuing scripts on init. For script registration that's fine, but for enqueues they should be done later, ideally on the wp_enqueue_scripts action which was designed especially for that purpose.

    Also, unless there's a specific reasons he needs that particular version of jQuery, then there's no reason to re-register it, the current version of WordPress includes jQuery 1.6.1 ..

  4. ratputin
    Member
    Posted 3 years ago #

    Thank you all for the input. I will attempt to contact the theme's autor and let you know if a fix is found.

    KO

  5. ratputin
    Member
    Posted 3 years ago #

    Nick Shylo, the theme's author, was great to work with...however, I found the conflict completely by accident. If you are trying to use the KingSize Theme and the vSlider plugin, you must deselect the "Enable/Disable Right-Click" option in the theme.

    Hope this can help someone else out there :)

    ~Rat

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags