title: WordPress PHP Fatal error: Call to undefined function add_action()
body: <p>On my WordPress (3.9.1) website I'm using the below code in my functions.php to add the stylesheet to the header of the theme:</p>
  
  <pre><code>function myd_scripts_styles() { 
      wp_enqueue_style( 'richwp-style', get_stylesheet_uri() );
  }
  add_action( 'wp_enqueue_scripts', 'myd_scripts_styles' );
  </code></pre>
  
  <p>From time to time my error.log shows the following:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Call to undefined function add_action()</p>
  </blockquote>
  
  <p>And it's referring to the above code. For me the code looks ok and it's also working as it should.</p>
  
  <p>Any ideas? Thanks.</p>