global $theme_key;
global $base_url;
$themes = list_themes();
$theme_object = $themes[$theme_key];
$settings = theme_get_settings($theme_key);
$logos = $base_url .'/'. $settings['logo_path']; //this is the logo path
That function does all the theme identifying and data fetching stuff for you and returns the key required (in the example above, it's the equivalent of skipping everything out and jumping right to the $settings['logo_path'] step).
If you really want you can use theme_get_setting('logo_path'), but that'll get you the manually-set logo path regardless of whether the theme is set to use it - if the theme is configured to use logo_default you're boned. 'logo' will return whichever of those paths the theme is currently using.
You don't need to declare or pass in your global $theme_key - if no second parameter is provided, the theme_get_setting() function assumes it's the current theme.
Comments
Right-click it
Select "view image", and then you'll see the path.
The exact location of the logo is set by your theme, so it may vary a bit from theme to theme, but it's generally in the theme folder.
Firebug is your friend, and will let you trace this and many other issues.
:)
Stay away from the DB
Do not poke around in the database for such information. Use the documented API.
The template system makes $logo available to page.tpl.php.
http://api.drupal.org/api/drupal/modules--system--page.tpl.php
http://api.drupal.org/api/function/template_preprocess_page/6
http://api.drupal.org/api/function/theme_get_setting/6
if you uploaded a new logo (not the logo fom the default theme)
l
Orrrrrr....
print theme_get_setting('logo');That function does all the theme identifying and data fetching stuff for you and returns the key required (in the example above, it's the equivalent of skipping everything out and jumping right to the
$settings['logo_path']step).If you really want you can use
theme_get_setting('logo_path'), but that'll get you the manually-set logo path regardless of whether the theme is set to use it - if the theme is configured to use logo_default you're boned. 'logo' will return whichever of those paths the theme is currently using.++Andy
This worked for me. Tx! And
This worked for me. Tx! And you might need to set the theme in second parameter
Logo Path
Hi,
This code works well, pls try,
global $theme_key;
$logo_url = theme_get_setting('logo_path', $theme_key);
print $logo_url;
global
You don't need to declare or pass in your global $theme_key - if no second parameter is provided, the theme_get_setting() function assumes it's the current theme.
++Andy
This will help to get & set
This will help to get & set logo of your theme.