Use Drupal installation’s base URL on theme/template

To be able to use base URL (server URL and subdirectory where Drupal is installed if any, like http://mydomain.com/drupal) on themes or content templates, $base_url scope must be modified before it can be used. Before your theme code, you should write:

< ?php
global $base_url;
(rest of theme/template code)
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *

This site uses Akismet to reduce spam. Learn how your comment data is processed.