try to rewrite posts.php for new function