Title: codex22's Replies | WordPress.org

---

# codex22

  [  ](https://wordpress.org/support/users/codex22/)

 *   [Profile](https://wordpress.org/support/users/codex22/)
 *   [Topics Started](https://wordpress.org/support/users/codex22/topics/)
 *   [Replies Created](https://wordpress.org/support/users/codex22/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/codex22/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/codex22/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/codex22/engagements/)
 *   [Favorites](https://wordpress.org/support/users/codex22/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/page/2/#post-3575915)
 * If I use this code, I get an error message:
    **Fatal error: Call to undefined
   function template_url() in C:\xampp\htdocs\wordpress\wp-content\themes\my_theme\
   functions.php on line 16**
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/page/2/#post-3575913)
 * Hi,
    this will only go to the themefolder, but won’t go into the js folder.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/page/2/#post-3575856)
 *     ```
       add_action('wp_enqueue_scripts', 'mh_superfish');
           function mh_superfish() {
       	if(!is_admin()) wp_enqueue_script('superfish', plugins_url( 'js/superfish.js', __FILE__ ), array('jquery'), '1.4.8', TRUE);
       	if(!is_admin()) wp_enqueue_script('superfish-args', plugins_url( 'js/superfish_args.js', __FILE__ ), array('jquery'), '1.4.8', TRUE);
           }
       ```
   
 * That’s the complete code.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/page/2/#post-3575848)
 * I did, and it will work, if I can change this code:
    `plugins_url( 'js/superfish.
   js', __FILE__ ), array('jquery'), '1.4.8', TRUE`
 * so the script will look in the theme directory.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575846)
 * Yes I did, but this code is form a plug-in called “superfish menu”. I wanted 
   to integrate this plug-in into my theme. So I thought I could do this by add 
   this code to the functions.php. I don’t want the plug-in to be activated, I want
   it to be active straight from the beginning.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575797)
 * I tried, but it is a bit hard. How do i rewrite this code:
 *  `plugins_url( 'js/superfish.js', __FILE__ ), array('jquery'), '1.4.8', TRUE)`
 * so it will look in the theme folder???
 * _[[No bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping). If it’s 
   that urgent, consider [hiring someone](http://jobs.wordpress.net/).]_
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575786)
 * That was a theme from a tutorial (newthinktank.com). But even I swtich back to
   my theme, I get this message:
 * > Fatal error: Call to undefined function template_url() in C:\xampp\htdocs\wordpress\
   > wp-content\themes\artist_theme\functions.php on line 16
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575777)
 * Okai I deactivated the plugin, but now I get this message:
 * > Fatal error: Call to undefined function template_url() in C:\xampp\htdocs\wordpress\
   > wp-content\themes\NTT-Cindy-Theme\functions.php on line 16
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575771)
 * This is the message I got.
 * > >Fatal error: Cannot redeclare mh_superfish() (previously declared in C:\xampp\
   > htdocs\wordpress\wp-content\plugins\superfish\superfish.php:13) in C:\xampp\
   > htdocs\wordpress\wp-content\themes\artist_theme\functions.php on line 18
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575765)
 * Just a little. I am not that good at php.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to add a function to functions.php?](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/)
 *  Thread Starter [codex22](https://wordpress.org/support/users/codex22/)
 * (@codex22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-a-function-to-functionsphp/#post-3575756)
 * I use my own theme. ([http://ammantempel.net](http://ammantempel.net)) and now
   I want to add this code to my functions.php

Viewing 11 replies - 1 through 11 (of 11 total)