Skip to content

Commit

Permalink
parent theme paths for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBock committed Oct 5, 2017
1 parent 9364d89 commit dfceda9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/shortcode.php
Expand Up @@ -87,8 +87,13 @@ public function do_shortcode($atts){
ob_start();
$template = locate_template(self::THEME_PATH."/".self::TEMPLATE_NAME);
if('' != $template){
// theme or child theme
include $template;
} else if(is_file(get_template_directory()."/".self::THEME_PATH."/".self::TEMPLATE_NAME)) {
// parent theme
include get_template_directory()."/".self::THEME_PATH."/".self::TEMPLATE_NAME;
} else {
// plugin
include $this->plugin->dir."/templates/".self::TEMPLATE_NAME;
}
$result = ob_get_contents();
Expand Down

0 comments on commit dfceda9

Please sign in to comment.