codex22
Forum Replies Created
-
Forum: Themes and Templates
In reply to: How to add a function to functions.php?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 16Forum: Themes and Templates
In reply to: How to add a function to functions.php?Hi,
this will only go to the themefolder, but won’t go into the js folder.Forum: Themes and Templates
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?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. If it’s that urgent, consider hiring someone.]
Forum: Themes and Templates
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?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
In reply to: How to add a function to functions.php?Just a little. I am not that good at php.
Forum: Themes and Templates
In reply to: How to add a function to functions.php?I use my own theme. (https://ammantempel.net) and now I want to add this code to my functions.php