Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Which is best way to find URI in child Theme.

<?php echo get_template_directory_uri(); ?>
<?php bloginfo('template_directory'); ?>

Below given code works but it has "stylesheet" in it, sounds like its a hake to find URI. Is this the only solution ?

<?php echo get_stylesheet_directory_uri(); ?>
<?php bloginfo('stylesheet_directory'); ?>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes, stylesheet is for child themes, template for parent themes. Andrew Nacin has explained that recently on wp-hackers:

child themes were originally just style.css and functions.php. That's why "template" refers to the parent theme and "stylesheet" refers to the child theme.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.