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.
we can do drupal_get_path("theme","garland")
but not
$temp = $theme_path;
global $theme_path; $temp = $theme_path;
$temp = function_in_templatephp();
I have tried those after cache has been cleared
Comments
Comment #1
GiorgosKrelated
#389378: Include Files
#629052: Include function from template.php
Comment #2
Pedro Lozano CreditAttribution: Pedro Lozano commentedI haven't been able to reproduce this. I've tried a function in the template.php of the theme and it has worked fine.
Are you trying to use a template.php different from the current theme?
Also try calling init_theme() at the beginning of your code, if for some reason your code is being executed before the theme has been initialized then the template.php has not already been included.
Comment #3
mmjvb CreditAttribution: mmjvb as a volunteer commented