Grow your CSS skills. Land your dream job.

Use Google-Hosted JavaScript Libraries (…still the Right Way

  • # October 30, 2009 at 3:46 pm

    Hello All!

    I’m farely new at messing around with WordPress and in a recent screen-cast #73, http://css-tricks.com/video-screencasts/73-wordpress-theme/3 Chris showed how load Google-Hosted JQuery in the WordPress function.php page and Chris also has a post on Digging into WordPress about this too, http://digwp.com/2009/06/use-google-hosted-javascript-libraries-still-the-right-way/ ). In that a article they mention using the "admin_is" conditional tip so as not too mess up the Rich-text editor on the admin side. Unfortunately, I’m fairly new to WordPress and don’t know how to go about doing this. Can someone help me do that?

    Here is my function.php file:

    Code:
    < ?php

    automatic_feed_links();

    if( !is_admin()){
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"), false, '1.3.2');
    wp_enqueue_script('jquery');
    }
    if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
    'before_widget' => ‘

  • ‘,
    ‘after_widget’ => ‘
  • ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘

    ‘,
    ));
    }
    ?>

And here is my header.php file:

Code:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>




>

Any help someone could give me would be great! My Admin is messed up because of this.

Thanks,
Hal

# October 30, 2009 at 5:51 pm

Okay, so I just realized that I have the "is_admin" conditional statement in there. So, that is not it. Here are the warnings I’m getting on the admin side:

Warning: Cannot modify header information – headers already sent by (output started at /home/newhop9/public_html/newsite/wp-content/themes/NHFC/functions.php:1) in /home/newhop9/public_html/newsite/wp-includes/classes.php on line 1586

Warning: Cannot modify header information – headers already sent by (output started at /home/newhop9/public_html/newsite/wp-content/themes/NHFC/functions.php:1) in /home/newhop9/public_html/newsite/wp-includes/pluggable.php on line 865

So, if anyone can help me out. That would be awesome!

Thanks,
Hal

# October 30, 2009 at 8:35 pm

Could you try running through your plugins and other code to see if it’s not one of them causing an error? Everything on the script you provided should work.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".