bug fixes and tie posts per page to wordpress setting