add while loop counter for grid display of the post