Added function to main.js for post list