Drupal 7: Logo path of current theme or any theme

In Drupal theme, each theme has a logo image files. We can use this logo images whatever we need. The below example will help us to print current theme logo as well as any theme logo.

Current Theme Logo:

global $theme_key;
$logo_url = theme_get_setting('logo_path', $theme_key);
print '< img src="' . $logo_url . '" alt="Logo" />';

Specific Theme Logo:

$theme_key = 'bartik'; // Theme name.
$logo_url = theme_get_setting('logo_path', $theme_key);
print '< img src="' . $logo_url . '" alt="Logo" />';
Category: