[wp-hackers] howto including full path in javascript file.

Mitch Canter | studionashvegas mitch at studionashvegas.com
Mon Feb 8 17:57:10 UTC 2010

One of two options works - if you are keeping the javascript files in your
root directory, prepend the urls with <?php bloginfo('siteurl'); ?>.  If
you're doing it only within your template, use <?php
bloginfo('template_directory'); ?>


src="<?php bloginfo('siteurl'); ?>/js/thickbox.js"


<img src="<?php bloginfo('siteurl'); ?>/js/img/thickbox.jpg">

Good for linking to images too.

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Bjorn Wijers
Sent: Monday, February 08, 2010 11:46 AM
To: wp-hackers at lists.automattic.com
Subject: [wp-hackers] howto including full path in javascript file.


I was wondering what other people use to include full paths in their
theme javascript files and keep it dynamic (so no hardcoded paths!). For
instance I would like to call some images in my javascript file and I
need to use a full path. What would be the best practice for this?




met vriendelijke groet,
Bjorn Wijers

* b u r o b j o r n .nl *
digitaal vakmanschap | digital craftsmanship

Concordiastraat 68-126
3551 EM Utrecht
The Netherlands

phone: +31 6 49 74 78 70
wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list