Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add the file /functions.php into your theme...
#1
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?
Reply
#2
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.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
#3
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/
Reply
#4
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 .
Reply
#5
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.
Reply
#6
(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.
Reply
#7
One step at a time!! LOL!!! thanks Carlos!!! Little by little I'll get the hang of it!! Smile
Reply




Users browsing this thread: 1 Guest(s)