Posts: 20
Threads: 8
Joined: Aug 2009
I noticed a problem after upgrading to 1.7 from 1.5. I removed the includes for my functions.php from the theme files and received an error stating a function used in a component could not be found. The function is in my functions.php file, which is located in my theme folder. The fix was to edit the index.php file in the webroot. I moved the check and include for the local functions.php file above where you load the theme files. Worked out fine. Anyone else seen that behavior?
Posts: 1,848
Threads: 86
Joined: Aug 2009
So right now the functions.php file isn't being included anywhere, but it is working?
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 20
Threads: 8
Joined: Aug 2009
Yes, it was/is being included. The problem went away after I moved the paragraph to include the functions.php BEFORE loading the template file. My template file had a component which referenced a function in the functions.php file. When the template file processed, it gave an error that it couldn't find the function. So, I load the functions.php first, then the template.
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);
Posts: 1,848
Threads: 86
Joined: Aug 2009
oooohhhhhh, very good catch. I can't believe I never noticed this. I will fix it in the next release.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!