title: Count Total Images attach to post and print result in title - wordpress
body: <p>I want to show total number of images in my post title. for ex: "my post is This car for sale ( 4 images)"  if this is the title i want to print 4 in my title before images. i try this code yet but it show 0. i dont know why. so can you please help me in this. Please note: im new to php and wordpress.</p>
  
  <pre><code>$count = count( $attachments );
  $specific = array();
  $i = 1;
  
  foreach ( $attachments as $attachment ) {
      $specific[$attachment-&gt;ID] = $i;
      ++$i;
  }
  </code></pre>