title: Count all special custom fields per post of a category (Wordpress)
body: <p>With this script my special custom field "Nickname" is counted only once, also if these field is available twice or more in a post.</p>
  
  <p>Is there a way to count all special custom fields called "Nickname" in a post?</p>
  
  <p>Thats the script:</p>
  
  <pre><code>&lt;?php
  $posts_with_nickname = get_posts(array(
          'category__in' =&gt; array(2,5),
          'meta_key' =&gt; 'Nickname',
          'showposts' =&gt; -1,
  ));
  
  printf('I have %d posts with "Nickname"!', count($posts_with_nickname));
  ?&gt;
  </code></pre>