Abstracted logged and non-logged getPosts to one function, fixed non-logged site behavior