title: Place category_description in the meta description (wordpress)
body: <p>Header in my theme I created the following code for the meta description:</p>
  
  <pre><code>&lt;?php if (is_single() || is_page()) { ?&gt;
  &lt;meta name="description" content="&lt;?php echo metadesc($post-&gt;ID); ?&gt;" /&gt;
  &lt;?php }else{ ?&gt;
  &lt;meta name="description" content="&lt;?php bloginfo('description'); ?&gt;" /&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>and included this code in my function.php:</p>
  
  <pre><code>function metadesc($pid) {
  $p = get_post($pid);
  $description = strip_tags($p-&gt;post_content);
  $description = str_replace ("\n","",$description);
  $description = str_replace ("\r","",$description);
  if (strlen($description) &gt; 150) {
  return htmlspecialchars(substr($description,0,150) . "...");
  }else{
  return htmlspecialchars($description);
   }
  }
  </code></pre>
  
  <p>now I want to also incorporate category_description the theme header :</p>
  
  <pre><code>&lt;?php if ( is_category() ) { echo category_description(); } ?&gt;
  </code></pre>
  
  <p>can you help me how can I do? thanks</p>