Template override error when using child theme. – UserPro Forums https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/feed/ Mon, 06 May 2024 03:10:22 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-44376 <![CDATA[Template override error when using child theme.]]> https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-44376 Fri, 21 Nov 2014 20:04:14 +0000 Nazeem Hi,

I wanted to override the default templates, so I followed the instructions as provided:

I created the userpro folder in my-theme. i.e: my-theme/usepro.
Then I placed the template in that folder like this: my-theme/userpro/login.php.

However, when viewing the page, I get the following error:

I did some research myself, and is seems that in shortcode-main.php you are using the following method: get_template_directory(). Because I am using a child-theme, this method will return the path to the parent theme. Could you make use of get_stylesheet_directory(), so it will get the path to the child theme, if a child theme is active.

]]>
https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-44536 <![CDATA[Reply To: Template override error when using child theme.]]> https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-44536 Thu, 27 Nov 2014 22:48:48 +0000 Nazeem up..

]]>
https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-46117 <![CDATA[Reply To: Template override error when using child theme.]]> https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-46117 Wed, 18 Feb 2015 19:01:48 +0000 nickhempsey This needs to be bumped. I’m running a child theme as well.

This is a super simple change that shouldn’t take more than 2 seconds using search and replace.

]]>
https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-46120 <![CDATA[Reply To: Template override error when using child theme.]]> https://forum.userproplugin.com/forums/topic/template-override-error-when-using-child-theme/#post-46120 Wed, 18 Feb 2015 21:39:12 +0000 nickhempsey another note… there are multiple calls to get_template_directory_uri(), these would all need to be changed to get_stylesheet_directory_uri(). This will ensure that the stylesheets are loading on the front end from the proper directory.

]]>