Refactor displying of post in sidebar menu