title: Plugin function not pulling data
body: <p>I am currently working on a plugin. As such, I inserted a block of code in the header with a function. The code is supposed to be pulling data from custom fields but it returns empty tag. However, it works if I add it directly to the header. Any ideas what the problem is? My code looks like below.  </p>
  
  <pre><code>&lt;?php 
  function pyramid() {
    ?&gt;
  &lt;meta name="description" content="&lt;?php $desc = get_post_meta($post-&gt;ID, 'description', true); if($desc) { echo $desc; } else { 
  
      // do nothing; 
  
  } ?&gt;" /&gt;
  &lt;?php
  }; 
  add_action( 'wp_head', 'pyramid' );
  
  ?&gt;
  </code></pre>
  
  <p>It returns the result below when added through the plugin.</p>
  
  <pre><code>&lt;meta name=description content&gt;
  </code></pre>