php - WordPress Child Theme including includes files -


i working @ wordpress setup on local computer using ampps localhost. using delta theme created child theme (delta2-child). initial setup works great. however, need change file in includes folder called home-slider.php.

location of original file:

c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta\includes\home-slider.php 

location of child theme files:

c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta2-child\includes\home-slider.php 

if move home-slider file child theme folder[ delta2-child\includes\home-slider.php ], theme still uses parent themes home-slider file.

if add following ct's functions.php file:

require_once( get_stylesheet_directory_uri() . "/includes/home-slider.php" ); */ 

i following error:

warning: require_once(c:\program files (x86)\ampps\www\armstrong/wp-content/themes/delta/includes/home-slider.php) [function.require-once]: failed open stream: no such file or directory in c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta2-child\header.php on line 87  fatal error: require_once() [function.require]: failed opening required 'c:\program files (x86)\ampps\www\armstrong/wp-content/themes/delta/includes/home-slider.php' (include_path='.;c:\php\pear') in c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta2-child\header.php on line 87 

can knowledgeable soul tell me how refer home-slider file without gernerating error above.

you can use get_template_part function

change

require_once( get_stylesheet_directory_uri() . "/includes/home-slider.php" ); 

to

get_template_part(includes/home-slider); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -