Skip to content

Instantly share code, notes, and snippets.

@fatihtoprak
Created November 28, 2012 03:34
Show Gist options
  • Save fatihtoprak/4158870 to your computer and use it in GitHub Desktop.
Save fatihtoprak/4158870 to your computer and use it in GitHub Desktop.
ss
<?php
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;
++$i;
}
echo "{$specific[$post->ID]} / {$count}";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment