You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
We are experiencing loading errors when using template overrides for some pages!
I believe this issue is caused by functions such as tutor_load_template_from_custom_path(), which determine the target file path using the __DIR__ constant.
In such cases, if a template containing these functions (that rely on __DIR__) is overridden, the sub-template paths are resolved relative to the child theme template instead of the plugin directory. As a result, if the sub-template files are not also overridden, loading errors occur.
On the contrary, , when a template loaded using __DIR__ is overridden, the overridden template does not take effect. For example:
If the single-content-loader.php template is overridden, all associated templates—
single-lesson.php
single-assignment.php
single-preview-lesson.php
single-quiz.php
must also be copied into the child theme directory without any changes.
The following code demonstrates that single-content-loader.php is being loaded from the plugin's template directory rather than the child theme directory:
Hi
We are experiencing loading errors when using template overrides for some pages!
I believe this issue is caused by functions such as
tutor_load_template_from_custom_path()
, which determine the target file path using the__DIR__
constant.In such cases, if a template containing these functions (that rely on
__DIR__
) is overridden, the sub-template paths are resolved relative to the child theme template instead of the plugin directory. As a result, if the sub-template files are not also overridden, loading errors occur.On the contrary, , when a template loaded using
__DIR__
is overridden, the overridden template does not take effect. For example:If the
single-content-loader.php
template is overridden, all associated templates—single-lesson.php
single-assignment.php
single-preview-lesson.php
single-quiz.php
must also be copied into the child theme directory without any changes.
The following code demonstrates that
single-content-loader.php
is being loaded from the plugin's template directory rather than the child theme directory:tutor/templates/single-lesson.php
Line 11 in 7015253
The text was updated successfully, but these errors were encountered: