Can I get a "base URL" in Wordpress within a template file?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-05-17T10:46:09Z Indexed on 2010/05/17 10:50 UTC
Read the original article Hit count: 227

Filed under:
|
|

Usually in my PHP apps I have a base URL setup so I can do things like this

<a href="<?php echo BASE_URL; ?>tom/jones">Tom</a>

Then I can move my site from development to production and swap it easily and have the change go site wide (and it seems more reliable than <base href="" />.

I'm doing up a Wordpress theme, and I am wondering, does WordPress have anything like this built in, or do I need to redefine my own?

I can see ABSPATH, but that is the absolute file path in the file system, not something from the document root.

© Stack Overflow or respective owner

Related posts about php

Related posts about Wordpress