[wp-testers] Custom head meta data

Dougal Campbell dougal at gunters.org
Fri Dec 23 18:22:32 GMT 2005


David House wrote:
> On 22/12/05, Alex Biddle <heuristic at gmail.com> wrote:
>> Was wondering if the new version of Wordpress will have custom <head>
>> functionality. Ie. If you include a javascript file that is only going
>> to be used in one post, you only have to have the script included in
>> the <head> of that post; not in the template header.
> 
> You could write a plugin to do this. It would need to hook into
> wp_head and echo the <script> tag if is_single() returns true and
> $post->ID was what you need it to be. (remember $post is a global
> variable, so you'll need to put 'global $post' at the top of the
> function).

I wrote a plugin to do just that over a year ago:

http://dougal.gunters.org/blog/2004/06/17/my-first-wordpress-plugin-headmeta

note: my server is suffering a very heavy load right now, and I'm still 
trying to determine the source of the problem. If you have trouble 
reaching my site, wait a while and try again.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-testers mailing list