title: Fatal error: Call to undefined function
body: <p>I am trying to call a function which is defined in functions.php. But I can’t figure out why this error is coming.</p>
  
  <p>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.</p>
  
  <p>In the functions.php this is the function I have defined:</p>
  
  <pre><code>function get_my_header(){
    if(is_home()){ 
      get_header('client'); 
    }
    elseif(is_page('dashboard')){ 
      get_header('own'); 
    }
  }
  </code></pre>
  
  <p>from index.php <code>get_my_header()</code> is called with no error but when I try to access the same function from the admin page I am getting this error:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined function <code>get_my_header()</code></p>
  </blockquote>
  
  <p>The page where this error is coming has only this one line:</p>
  
  <pre><code>&lt;?php get_my_header(); ?&gt;
  </code></pre>