Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In my theme's page.tpl.php, I am using the following to print out my theme path (to call images from the theme directory):
<?php $theme_path = drupal_get_path('theme', variable_get('theme_default', NULL)); ?>
<img src="<?php echo $theme_path; ?>/img/foo.png" />
This of course leaves my theme looking in the wrong directory for images and breaks each one as switchtheme leaves the "default theme" intact.
Is there a way to work around this or a better way to call images in my theme that will work with switchtheme?
Comments
Comment #1
gthing CreditAttribution: gthing commentedAh looks like this works: