Added functionality for limiting post previews per page and adding pagination