Categories > TinyButStrong general >

Including functions through the templates

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ben
Date: 2008-10-12
Time: 15:05

Including functions through the templates

Hi everyone,

I'm working on a theme using TBS, and this theme requires some custom php functions. However I want to avoid making changes to the existing PHP script.

I've got these functions working fine but I'm trying to find out if the following is possible:

Is there a way to include the php file with the functions for the theme directly through one of the template files? I saw that it was possible to include a php file but so far I can't seem to get anything to work.

Thanks in advance & great system you've got here!
Ben
By: Skrol29
Date: 2008-10-12
Time: 22:51

Re: Including functions through the templates

Hi Ben,

Parameter "script=" enables you to run a PHP script. It is usually used in order to do some subtemptate work, but the script can be anything, like initializing a set of variables for a theme.

>I saw that it was possible to include a php file but so far
> I can't seem to get anything to work.

You have to provide more details if you want some other help on this point.

Regards,
By: Ben
Date: 2008-10-12
Time: 23:04

Re: Including functions through the templates

Thanks for your reply. I've been playing around with it this afternoon and managed to find a solution, I really appreciate you taking the time to reply though. Thanks!

In the end I solved it with a basic [onload;script='functions.php'] (like you've suggested) I don't know why I couldn't get it to work before. :-/

Thanks again!