- This topic has 1 reply, 2 voices, and was last updated 1 year, 8 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Free Themes › PhotoBrust › PhotoBrust Child Theme
Hello,
I tried to create a child theme to make some changes, but it would give errors every time I tried to activate it, crashing the entire site. Even when using WEN Solution’s WP Child Theme Generator. After searching for some time about the problem, I found something from another theme that would explain what the problem was:
– require get_theme_file_path()
This code made so it would always try to open the codeblocks and stuff from the child theme’s directory, changing it to “require get_template_directory()” solved the problem and made it possible use a child theme without crashing the site. The problem is, I had to make the change in the original function.php from the parent theme, which is not a good practice, right?
So, I came here to get support about this, as the changes to the code disappear when the theme gets an update.
Thank you for your time
Yes, changing the parent theme is not a good approach as the code will disappear whenever the theme gets updated.
For the solution to your issue don’t change anything in the parent theme just copy the whole ‘inc’ folder
from the parent theme and paste it to the child theme. Since get_theme_file_path() get the path from the activated theme and there are no files of that path in the child theme so we have to add an inc folder. Besides that, you can customize anything in the child theme
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |