Saturday, May 21, 2016

WordPress get active theme directory

To get the full directory path of the active theme use the following piece of code.

<?php echo get_template_directory(); ?>

If you are using a child theme then it will return the path of the Parent theme only. To get the child theme directory path use the following code.

<?php echo get_stylesheet_directory(); ?>

This will give you the path of the child theme.

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...