[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'); ?>
Example:
src="<?php bloginfo('siteurl'); ?>/js/thickbox.js"
or
<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.
Hi,
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?
Thanks,
grtz
BjornW
--
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
http://www.burobjorn.nl
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list