GetSimple Support Forum

Full Version: Wrong inclusion of Template functions.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

if I interpreted the intention of the last lines in /root/index.php right you want to offer a possibility for Theme Builders to include their "own" functions in order to enhance the template - that is very cool !!

In order to profit from the functions.php within the template directory, this include has to be called before the template files...

My suggestion for index.php is:

Code:
// include the functions.php page if it exists within the theme
    if ( file_exists("theme/".$TEMPLATE."/functions.php") ) {
        include("theme/".$TEMPLATE."/functions.php");    
    }    
    
    // include the template and template file set within theme.php and each page
    if ( (!file_exists("theme/".$TEMPLATE."/".$template_file)) || ($template_file == '') ) { $template_file = "template.php"; }
    include("theme/".$TEMPLATE."/".$template_file);

On my install it works perfect !