Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the path of the current drupal theme?

The Drupal API has drupal_get_path($type, $name) which will give the path of any particular theme or module. What if I want the path of the current theme?

like image 591
Steven Noble Avatar asked Nov 19 '08 23:11

Steven Noble


People also ask

What is currently the default Drupal theme?

Bartik is the default theme for Drupal 8.

What are Drupal 8 themes?

Themes in Drupal sites. Themes are what make a Drupal website look the way it does. Themers, or theme developers, use HTML, CSS, JavaScript, and other front-end assets in order to implement a design for their site. Each individual theme is a collection of files that define the presentation layer for your application.

Which of the following is regions in Drupal theme?

Each theme provides a set of named regions, such as Header, Content, and Sidebar, where site builders may choose to place their content.


2 Answers

Use the path_to_theme function.

like image 169
FGM Avatar answered Oct 05 '22 08:10

FGM


this should work (doc):

global $theme; $path = drupal_get_path('theme', $theme);  // there's also a $theme_path global  global $theme_path; 
like image 25
Owen Avatar answered Oct 05 '22 06:10

Owen