Check if there is any posts before looping on them