
Working with WordPress child themes: Including files and getting the theme path
Saturday, October 30th, 2010Recently I have been creating child themes in wordpress and It turns out that we cant use TEMPLATEPATH for including files and template_directory for getting the full theme directory path. These reference the actual parent theme. We need to use stylesheet_directory and STYLESHEETPATH.
Here are two examples we would use when dealing with child themes:
<?php include (STYLESHEETPATH . ‘/includes/pageheader.php’); ?>
<script src=”<?php echo bloginfo(‘stylesheet_directory’); ?>/js/modernizr-1.5.min.js”></script>
References: