Search for Resources and Solutions

Get the theme's path in a Midrub Theme

Midrub has several types of themes and each of them have a function to call the theme path. Why you need this? For example you want to require a file from your theme, like a Inc file or another file in the code. With the function the_theme_path() you will get the exact location of your theme. 

If you want to load for example the file main.php from your core folder, you just could use:


                                                
require_once the_theme_path() . '/core/main.php'; 


The function the_theme_path() will save your time and is the best choice.

Was this article helpful?