Display total number of attachments to a Post

global $post;
$attachments = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );

$count = count( $attachments );
$specific = array();
$i = 1;

foreach ( $attachments as $attachment ) {
    $specific[$attachment->ID] = $i;

echo "Image {$specific[$post->ID]} of {$count}";


Replace a flickr image url from big to small size with substr_replace

I have been trying out the change the flickr image url from the big size to small and medium size without using the image url’s again.I have landed up with the solution.

echo substr_replace($url,"m",-5,1);
echo "<br />";
echo $url;