<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>WordPress Ideas &#187; Tag: stylesheetpath - Recent Posts</title>
		<link>http://wordpress.org/ideas/tags/stylesheetpath</link>
		<description>WordPress Ideas &#187; Tag: stylesheetpath - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Sat, 25 May 2013 05:16:56 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://wordpress.org/ideas/rss/tags/stylesheetpath" rel="self" type="application/rss+xml" />

		<item>
			<title>Robin174 on "Ability to override included files in child themes"</title>
			<link>http://wordpress.org/ideas/topic/ability-to-override-included-files-in-child-themes#post-24141</link>
			<pubDate>Fri, 01 Feb 2013 11:10:24 +0000</pubDate>
			<dc:creator>Robin174</dc:creator>
			<guid isPermaLink="false">24141@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>This is a great idea - are we any closer to it?<br />
Struggling to override 'require_once' and 'define' in parent theme to call a new file in a child theme...
</p>]]></description>
					</item>
		<item>
			<title>Ian Dunn on "Ability to override included files in child themes"</title>
			<link>http://wordpress.org/ideas/topic/ability-to-override-included-files-in-child-themes#post-18867</link>
			<pubDate>Wed, 02 Mar 2011 19:51:35 +0000</pubDate>
			<dc:creator>Ian Dunn</dc:creator>
			<guid isPermaLink="false">18867@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>One of the biggest limitations of child themes right now is that only the child theme's template files are automatically loaded. If you want to override a file that the parent theme includes (e.g., themedir/lib/foo.php) then you have to find the file that calls require_once(TEMPLATEPATH . '/lib/foo.php) and override it to call  require_once(STYLESHEETPATH . '/lib/foo.php), and in some cases you have to do that 3 or 4 times until you get to the top of the hierarchy.</p>
<p>It'd be better if there were some kind of wp_require_once() function that would take a path (relative to the theme dir), and then check if there was a child theme file to replace the parent theme one.</p>
<pre><code>function wp_require_once($path)
{
    if( TEMPLATEPATH != STYLESHEETPATH &#38;&#38; is_file(STYLESHEETPATH . $path) )
        require_once (STYLESHEETPATH . $path);
    else
        require_once (TEMPLATEPATH . $path);
}</code></pre>
<p>Then theme developers could use wp_require_once('lib/foo.php') instead of require_once(TEMPLATEPATH . 'lib/foo.php'). If a child theme was being used and had a replacement file, WP would load it; otherwise it would load the parent file.
</p>]]></description>
					</item>

	</channel>
</rss>
