Home Forums Free Themes PhotoBrust PhotoBrust Child Theme

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #189346
    Sany
    Participant

    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

    #189357
    Psink
    Keymaster

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.