0

I'm trying to call multiple JQuery scripts using wp_enqueue_script. The call to JQuery works perfectly but the second call to cufon doesn't. I'm not a php or javascript expert - could anyone lend a hand, is there a best practice method for this?

function my_init_method() {
    if (!is_admin()) {
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }
}    

add_action('init', 'my_init_method');

function my_init_method2() {
    if (!is_admin()) {
        wp_deregister_script( 'cufon' );
        wp_register_script( 'cufon', 'http://mydomain.com/wp-content/themes/simplefolio/js/cufon-yui.js');
        wp_enqueue_script( 'cufon' );
    }
}    

add_action('init', 'my_init_method2');

1 Answer 1

1

I'm not good at this, but it could be because Cufon is not included in Wordpress?

So, you are deregistrating a script that is not included..

http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress

1
  • Hit the nail on the head! Commented Mar 12, 2011 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.