Fatal error: Call to undefined function
-
I am trying to call a function which is defined in functions.php. But I can’t figure out why this error is coming.
Let me tell you in detail what I am trying to accomplish: there are two header files?—?client and admin. The client header will be accessed when the user enters into a page through index.php, but admin header will be accessed after an admin successfuly logged in.
In the functions.php this is the function I have defined:
function get_my_header(){ if(is_home()){ get_header('client'); } elseif(is_page('dashboard')){ get_header('own'); } }
from index.php get_my_header() is called with no error but when I try to access the same function from the admin page I am getting this error:
Fatal error: Call to undefined function get_my_header()
The page where this error is coming has only this one line:<?php get_my_header(); ?>
All files resides in one folder.
Please help ?
- The topic ‘Fatal error: Call to undefined function’ is closed to new replies.