add post counts to admin for sorting, refactor sorting code on front accordingly