Template Loader Error

Hi,
WP Frontend is recently failing to load the basic template “Blank Container header, footer” through the template-loader.php file. The weird thing is that this error only occurs on one of several pages that using the same template that will output different content through a plugin via short-code. (see screenshots below).

when i am switching on php-debug it shows me some detailed information that it cant load properly the template php-file. I can fix it by hard-coding the absolute server-path via in the template-loader.php as a non viable work-around:

$prefix = "/www/htdocs/w01824b9/choc-mate.de/wp-content/themes/pro/framework/legacy/templates/";
if(!str_starts_with($template, $prefix)) $template = $prefix . $template;

for some reason the template php-file is located in a legacy folder which looks weird although i am using Theme: Pro Version: 6.5.15

I am looking forward getting some advice and help

Hi Benedikt,

Thanks for reaching out.
You mentioned that you are using the Pro version 6.5.15 which is an older version of the theme. I would suggest you update the Pro to its latest version i.e. 6.6.4 and check if that resolves the problem, if not please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Also note that PHP warnings are not a blocker and you can suppress the warning messages by adding the define( 'WP_DEBUG', false ); code into the wp-config.php file.

Thanks

Hey,
updated everything, but unfortunately that did not help.
I added the login info to the original post.

Hey Benedikt,

I have logged and created a test page using the Blank Container | Header, Footer page template. I do not see the PHP Warning that is shown in the screenshot on your first post. You must have disabled thr PHP Debug Mode already. Be advised that this is just a PHP Warning and does not affect the operation of the theme. Based on the PHP Warning, it seems that the PHP str_starts_with() function is not supported by your PHP version. I scoured the latest Pro theme 6.6.4 version and the WordPress core 6.8 version. I did not find this line if(!str_starts_with($template, $prefix)) $template = $prefix . $template; by the way. This could mean that the PHP Warning is resolved when using the latest recommend PHP version, Pro theme and the WordPress core version.

Hope this helps.

Hi ruenel,

thanks for you effort. the error is still remaining. To describe it briefly: There is a plugin running that renders various user-ui for logged-in users depending on the browser-url. This plugin uses in the backend the same wp-short-code to visually route to the content content. So there are several pages starting with “user” in the pagename that effectively dont have any content except of the wp-shortcode. All pages have the template “Blank Container - Header, Footer” and everything used to run perfectly for a long time. After some update of WP and Theme Pro one of the user-page doesnt show no content at all (unless i invoke the workaround in the template-loader.php, the php-function str_starts_with()is working correctly in PHP8

Here are some screenshots with WP_Debug On. Please ignore the Deprecatde-Warning for now its not part of that problem. :slight_smile:

thanks for your help… I will disable wp_debug and turn on the workaround in the template-loader.php (Line 106 & 107) since users need to have proper access to the dashboard.

You are most welcome, Benedikt.
We really appreciate for letting us know.

Can you figure out, why the error is still there?
I would like to get rid of the work-around since every wp-update will reset it?
Is there some particular page-meta, that needs to be checked… as i said, 4 of 5 “user-” pages work, one doesnt.

Hey @benecito,

For us to fix, we first need to establish that what you’re reporting is a bug in our theme and not with the shortcode you’re using.

With that said, kindly test first other templates other than the blank template. If the issue persists, kindly activate the Twenty Twenty Five theme. If the issue still persists in the Twenty Twenty Five theme, the bug is in the shortcode. If not, we’ll list this issue in our tracker to be queued for fixing by our development team.

Please note that testing for a code conflict is best done in a staging site.

Thank you.

Hey,

did some more testing today and here are the results:
a) the issue happens with any template
b) the issue does not happen with then TwentyTwentyFive Theme
c) we realised the issue seems to be partially caused by another plugin called Theme My Login (https://thememylogin.com). If the login redirect is towards the user-dashboard page it stops working. When directed to a duplicate of user-dashboard that one stops working and the original one works again. Using TwentyTwentyFive everything works as expected.
So I think the issue is caused by a combination of Pro and Theme My Login. Can you reproduce the issue and maybe fix it from there on?

Hey @benecito,

Please test Pro without the Theme My Login and then let us know the result.

Thank you.

Hey,

if Theme My Login is deactivated it works. So I’m pretty sure it’s a combination of Theme My Login and Pro. Like I said it works when switching to TwentyTwentyFive.

Unfortunately, we do not provide support for third-party plugins, especially those that are not integrated with the theme. You can find a list of supported plugins here: https://theme.co/docs/version-compatibility.

For additional assistance, we recommend reaching out to the plugin developers or subscribing to our One service. Thank you for your understanding.