notices fix on every first post view

Previous code made every first post view display a notice.
This fixes the notice and introduces a more efficient way of getting the post meta.