Child theme issue with require_once syntax
-
Sorry if this has been discussed previously.
I am using the Papercore theme and have implemented a child theme, which is functioning correctly. However:
Ï want to modify the main home page template (homePage.php) to make the text content section full width. This involves commenting out the call to the side bar:
<?php get_sidebar('homeSidebar'); ?>and modiyfing the width of the #content div. This is all easy stuff. I have therefore placed a copy of homePage.php in my Child Theme folder and added the modified #content div to the child theme’s style.css. On loading the site, however, it throws this issue:
Warning: require_once(fader.php) [function.require-once]: failed to open stream: No such file or directory in /home/blahblah/public_html/wp-content/themes/papercore-child/homePage.php on line 21
Fatal error: require_once() [function.require]: Failed opening required ‘fader.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/blahblah/public_html/wp-content/themes/papercore-child/homePage.php on line 21
Line 20-22 of homePage.php have this syntax:
if($slider!='none' && $slider!=''){ require_once $slider.'.php'; }?>This is attempting to call “fader.php” in the parent theme folder because that is the slider I have chosen – but it obviously cannot find it in the child theme folder. If I include fader.php in the Child Theme, then the issue is resolved, but I’m wondering if I can modify line 21 to pull the correct file from the parent theme folder?
Anyone know how?
The topic ‘Child theme issue with require_once syntax’ is closed to new replies.