WordPress.org

Forums

LeagueManager
Could not load template... (6 posts)

  1. Paulio51
    Member
    Posted 2 years ago #

    Hi
    Wanted to first thank you for taking on this project. This is a wonderful plugin and I for one appreciate your time spent on this.

    After upgrading to the latest version of both wordpress and league manager I was getting the 'Could not load template' warning for a custom template I had on my home page. Digging deeper into the code to find out what the issue was as I had not changed anything other than upgrading I found the use of TEMPLATEPATH in shortcodes.php. Correct me if I am wrong but I understand that TEMPLATEPATH has been deprecated.

    Changing this to get_stylesheet_directory() fixed the issue (especially since I am using a child theme).

    Thanks
    Paul

    https://wordpress.org/plugins/leaguemanager/

  2. LaMonte Forthun
    Member
    Plugin Author

    Posted 2 years ago #

    I'm pouring through the code updating it to remove any strict errors and deprecated functions, so I appreciate the tip on this one, hadn't seen it before... I'll fix it in the next release.

  3. Paulio51
    Member
    Posted 2 years ago #

    No problem. I don't understand why it would all of a sudden start throwing this error though. From what I can gather TEMPLATEPATH has been deprecated since 3.0. Take your time as apparently I am one of a few, if not the only one, that uses a custom template under a child theme.

  4. LaMonte Forthun
    Member
    Plugin Author

    Posted 2 years ago #

    Hey Paul, I updated the code to include this change, sort of. I didn't go to child templates, just parents, I want to work with child themes a bit more to get it right. If you've got any code you'd like to share that I can possibly implement, let me know.

    Thanks

  5. Paulio51
    Member
    Posted 2 years ago #

    Hi LaMonte, was get_stylesheet_directory() throwing errors for you?
    My understanding of get_stylesheet_directory() is that it returns the stylesheet directory Path for the current theme/child theme. Shouldn't have any impact on the end user if they are using a standard base theme. I have tested with a base/regular theme and it points to the right directory on my local install.
    Just so we are on the same page I'm looking in shortcodes.php, the last 2 functions loadTemplate() and checkTemplate() in which you used get_template_directory(). Using get_stylesheet_directory() should point to the right directory whether you are using a regular theme or child theme.

    Thanks again for all your time on this. :-)
    Paul

  6. LaMonte Forthun
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Paul, I actually didn't test get_stylesheet_directory, I'll do that before I release the next version, probably today or tomorrow. Thanks for the help on this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • LeagueManager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.