I'm making a wordpress plugin, but when I try to run add_action(), this error comes up!
Ok, fine, I'll use the pastebin… (not that this was made clear to me in any way, though)
I'm having this problem as well. Trying to use
add_action() in functions.php to add a custom post type, but I get this error:
Fatal error: Call to undefined function add_action() in /home/jasoncarlin/haslayout.com/wp-includes/functions.php on line 4316
The code I'm using is straight out of the WordPress codex: http://wordpress.pastebin.com/pi1CH0nD
It seems I just can't use the add_action() function.. Maybe something is corrupted? I am using WordPress v3.0.1. Thanks for any help.
I figured out what was causing the problem for me. I was trying to call add_action() from the main functions.php file in my WP root. Stopped giving me trouble when I moved the call to the functions.php file inside my current theme.
Thanks for posting the follow-up escapist. I was having the same issue.
Most of the tutorials you read online assume you would know that when they talk about functions.php that it is the one residing in your theme folder.
This topic has been closed to new replies.