Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter fubhy

    (@fubhy)

    this is an example of how I solved this with a theme function…

    function do_include($file)
    {
    	$parent = get_template_directory() . '/';
    	$child = $parent . '../' . get_child_folder() . '/' . $file;
    	$parent = $parent . $file;
    
    	if(file_exists($child))
    		include($child);
    
    	elseif(file_exists($parent))
    		include($parent);
    }
    
    function get_child_folder()
    {
    	return array_pop(explode('/', dirname(get_bloginfo('stylesheet_url'))));
    }
Viewing 1 replies (of 1 total)