WordPress.org

Ready to get started?Download WordPress

Forums

Widget Builder
[resolved] Error in get_template_hierarchy... (5 posts)

  1. drbigfresh
    Member
    Posted 2 years ago #

    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/

  2. Timothy Wood
    Member
    Plugin Author

    Posted 2 years ago #

    Great catch! I will take a look further and add in error proofing for this in the next bugfix.

  3. Timothy Wood
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  4. Timothy Wood
    Member
    Plugin Author

    Posted 2 years ago #

    Looks to be working.

  5. Timothy Wood
    Member
    Plugin Author

    Posted 1 year ago #

    the template pathing folder has been updated in the lastest release v1.3 - let me know if you continue to have issues.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.