Archived topic
Same PHP error again
10 replies · Started by Dave on March 14, 2017
Every time I update the GP theme (I just did it now), I refresh the site and it gives me this:
Warning: require(/homepages/43/d622919337/htdocs/dev/wp-content/themes/generatepress/inc/woocommerce.php): failed to open stream: No such file or directory in /homepages/43/d622919337/htdocs/dev/wp-content/themes/generatepress-child/functions.php on line 256
Fatal error: require(): Failed opening required '/homepages/43/d622919337/htdocs/dev/wp-content/themes/generatepress/inc/woocommerce.php' (include_path='.:/usr/lib/php5.5') in /homepages/43/d622919337/htdocs/dev/wp-content/themes/generatepress-child/functions.php on line 256
I know it has something to do with my child theme but why does it always happen? I use Child Theme Configurator to make my GP child theme.
Likely because your child theme functions.php file has all of the GP functions in there, when it should only consist of your custom functions.
If you remove all functions in your functions.php file except for the custom functions you've added, it won't be a problem.
Yup that's what it was - fixed now. So last time this happened, it was the same thing. I know for sure I had only the custom functions in the child functions.php. Maybe it the Child Theme Configurator. Do you recommend a method for creating child themes that work well with GP?
- Dave
A child theme should just be completely empty to start, and then you add what you need when needed.
It should have an empty style.css file, and an empty functions.php file.
You can find a blank child theme here: https://docs.generatepress.com/article/using-child-theme/
Ok sounds good, thank you.
Ok one other questions - pretty sure its related to the new theme. My mobile site is all screwed up now:

I do have some CSS that incorporates negative margin values - that could be causing it... but its was never a problem until about an hour ago after the theme update.
Try removing all that negative margin - looks like that's what causing the issue.
That is definitely whats causing it. I removed them and the mobile looks much better. The reason I have negative margin is to space the content properly on the page on desktop view.
Would it be good practice to use @media max width in css and target the larger screen size? That way mobile is unaffected?
Or I guess it would be @media min width
Depends on what you are trying do. Sometimes it's good to target mobile only and sometimes it's good to target desktop only.
Checkout this post: https://generatepress.com/forums/topic/how-do-i-search-for-my-previous-posts/#post-263744
Ok cool. Yah I targeted min width 1025 and it worked like I want it too.
Thank you!