views:

19

answers:

1

Hi,

I am adding a new file called subtypes.php to my theme /library/includes in order to allow for a dynamic dropdown list. This file uses functions from /library/functions/custom_functions.php.

The problem: whenever I call any function from custom_functions.php, I get fatal errors: Call to undefined function add_action(), other times I get undefined function get_option(). It seems to me that the new file doesn't load some default libraries or so....Any help willl be very much appreciated.

Thank you very much!

A: 

Put include_once "../functions/custom_functions.php" at the top of subtypes.php

Joseph
I did it and that's why I get the fatal error for the add_action(). Here is how the custom_functions.php look like<?php>add_action($blabla);function A{}function B{}%>I call function A() from subtypes and I get add_action() is undefined.Thanks,Youssef
Please edit your question and paste in the code from custom_functions.php that shows the `add_action()` function being defined.
Joseph
Never mind. it's a hassle to clean the code and post it here! Thanks any way.
The problem is that we can't help you troubleshoot your code without seeing the code to begin with.
Joseph
It's a long file that I need to sanitize, the structure was given above. I need to know how to tell a file to load some default hooks to understand the meaning of add_action() and get_option().....