Child theme URI for WordPress files instead of Parent theme

For WordPress theme developers, remember that when you need to reference the local theme template directory, the following call will reference the parent theme:

get_template_directory_uri();

Intuitively, you might look at this and say that the child theme is of course the active theme.  This call will actually return the URI of the active parent theme, if you’re using a child.  Use the following call to get the location of your active child theme:

get_stylesheet_directory_uri();

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>