Sorting in db query; filtering out unpublic posts; using posts.guid instead of manually built links