updated posts.php for category function