Title: [Plugin: Widget Builder] Error in get_template_hierarchy&#8230;
Last modified: August 20, 2016

---

# [Plugin: Widget Builder] Error in get_template_hierarchy…

 *  Resolved [drbigfresh](https://wordpress.org/support/users/drbigfresh/)
 * (@drbigfresh)
 * [14 years ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/)
 * There is an error in your code. This function:
    function get_template_hierarchy(
   $template, $class = null) { // whether or not .php was added $template = rtrim(
   $template, ‘.php’);
 * if ( $theme_file = locate_template( array($this->token . ‘/’ . $template . ‘.
   php’) ) ) {
    etc…
 * locate_template() needs the .php extension or it doesn’t work. Or I screwed up,
   but that ended up making it work for me with a child theme…
 * [http://wordpress.org/extend/plugins/widget-builder/](http://wordpress.org/extend/plugins/widget-builder/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Timothy Wood](https://wordpress.org/support/users/codearachnid/)
 * (@codearachnid)
 * [14 years ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/#post-2756071)
 * Great catch! I will take a look further and add in error proofing for this in
   the next bugfix.
 *  Plugin Author [Timothy Wood](https://wordpress.org/support/users/codearachnid/)
 * (@codearachnid)
 * [14 years ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/#post-2756121)
 * So the more I’ve tested this I’m not sure I’m having the same issue you stated
   with the lookup – any chance you could give me details about how you’re using
   the template hierarchy method?
 *  Plugin Author [Timothy Wood](https://wordpress.org/support/users/codearachnid/)
 * (@codearachnid)
 * [14 years ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/#post-2756149)
 * Looks to be working.
 *  Plugin Author [Timothy Wood](https://wordpress.org/support/users/codearachnid/)
 * (@codearachnid)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/#post-2756202)
 * the template pathing folder has been updated in the lastest release v1.3 – let
   me know if you continue to have issues.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Widget Builder] Error in get_template_hierarchy…’ is closed 
to new replies.

 * ![](https://ps.w.org/widget-builder/assets/icon-256x256.png?rev=985727)
 * [Widget Builder](https://wordpress.org/plugins/widget-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-builder/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Timothy Wood](https://wordpress.org/support/users/codearachnid/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-widget-builder-error-in-get_template_hierarchy/#post-2756202)
 * Status: resolved