July 1st, 2009


1
Jul 09

A better way to use jQuery in WordPress Themes

Since a lot of people come to my blog looking for a way to add jQuery into their wordpress themes, it turns out that there is a better way to do it than the way that I previously blogged. You can include jQuery from the current WordPress install by calling:

wp_enqueue_script("jquery");

Followed by:

wp_head();

You can even use it to include the jQuery library that you are adding with your theme (so that it works after wordpress updates their library):

//First you have to get rid of the one that wordpress includes:
wp_deregister_script('jquery');
//Then you have to replace it with your own:
wp_register_script('jquery', (bloginfo("template_url")."/js/jquery.min-1.3.2.js"), false, '1.3.2');
//or you could use the one that google so kindly provides:
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"), false, '1.3.2'); 
//Then enqueue it
wp_enqueue_script('jquery');

1
Jul 09

Daily Digest for July 1st

@zoster Awwww… [#]
9:00pm via Twitter
"just your real name, your home address, your IP address, your home and cell number…" That sounds pretty personal! http://bit.ly/1DNXzK [#]
9:02pm via Twitter
9:17pm via Twitter
RT @MarsRovers: Today a test rover was driven into simulated Martian soil to begin escape testing. Pics: http://bit.ly/freespirit [#]
9:27pm via Twitter
And now something completely random from @wilw: Elf shot the food! [#]
9:30pm via Twitter
@lyndzrokz is beck from the mouse hunt and she only killed one squirrel [#]
9:46pm via Twitter
@lyndzrokz says it was an accident… he fell down the stairs… ran into a door [#]
9:47pm via Twitter
No work tomorrow! Yay! Same with you? Coincidence! [#]
9:55pm via Twitter
@zoster The squirrel that died [#]
9:58pm via Twitter
@codinghorror What is wrong with choice? [#]
10:04pm via Twitter
Now keep in mind that 110% of all young men his age group have cell phones [#]
10:14pm via Twitter
10:19pm via Delicious
10:20pm via Twitter
The transition from nuclear arms development to frisbee research led to the demise of the Soviet Union and the eventual end of the Cold War. [#]
10:21pm via Twitter
10:22pm via Delicious
Mojito is being loud… rattling his cage like a prisoner… [#]
11:22pm via Twitter
Posted Changeset [123]: Turns out that I had already added the error reporting/logging code…
11:47pm via ShoestringPHP
Posted Changeset [124]: 10 tests passed: Connect, Disconnect, QueryDb, NewQuery, EscapeQuery, …
12:19am via ShoestringPHP
RT @codinghorror: By the powers of Greyskull, it’s Bollywood He-Man!! http://bit.ly/ynSVZ [#]
9:55am via Twitter
Crazy Indians… Superman is not see through… http://bit.ly/eNJbM [#]
10:02am via Twitter
Designers assumed that housewives would do all the cooking, and yet, also assumed they’d be open to learning binary http://bit.ly/12qutL [#]
11:30am via Twitter
Posted Changeset [125]: Added html5 doctype to the doctype function
1:05pm via ShoestringPHP
@elliotjaystocks People promoting your site redesign on their blogs/in twitter? [#]
5:29pm via Twitter