GetSimple Support Forum
Add the file /functions.php into your theme... - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Add the file /functions.php into your theme... (/showthread.php?tid=3628)



Add the file /functions.php into your theme... - Timbow - 2012-09-29

From the Wiki:
Quote:Add the file /path/to/getsimple/theme/your-theme/functions.php into your theme to add custom functions that can be used within your theme.

Can someone explain that to me please?

Where do you get this file? What are these custom functions? Do I have to write it myself?


Add the file /functions.php into your theme... - sal - 2012-10-01

It's simply an optional file a theme author might like to include with any custom functionality for that theme. Whether you (as a theme author) include a file called functions.php and what it contains is up to you.


Add the file /functions.php into your theme... - eatons - 2012-10-01

Timbow Wrote:From the Wiki:
Where do you get this file? What are these custom functions? Do I have to write it myself?


I think you will find a good overview on the 'function.php' file by reading this addendum to my tutorial on outlining.

http://eatons.net/tutorials/innovationoutline/addendum/


Add the file /functions.php into your theme... - Timbow - 2012-10-03

Thanks. I am working my way through the free php course here: http://www.homeandlearn.co.uk/php/php.html

When I have got through it I will take another look at functions.php .


RE: Add the file /functions.php into your theme... - lnickel - 2013-10-10

Sorry to bump this back up.

I'm trying ot add my scripts in the function.php but am having a bit of a fuss getting it to work.

Here is what I have so far. I kind of like working this way instead of adding them directly into the template.

PHP Code:
function add_scripts() {
    echo 
"<script src='"get_theme_url() . "/js/utility.js'></script>";
}

add_action('theme-header','add_scripts'); 

Yeh...not working. It prints out the url but not in the script tag.


RE: Add the file /functions.php into your theme... - Carlos - 2013-10-10

(2013-10-10, 12:31:31)lnickel Wrote:
PHP Code:
function add_scripts() {
    echo 
"<script src='"get_theme_url() . "/js/utility.js'></script>";
}

add_action('theme-header','add_scripts'); 

Yeh...not working. It prints out the url but not in the script tag.

Replace get_theme_url() by get_theme_url(false) to return the value instead of echoing it.


RE: Add the file /functions.php into your theme... - lnickel - 2013-10-10

One step at a time!! LOL!!! thanks Carlos!!! Little by little I'll get the hang of it!! Smile