refactor recentposts block to use an api function instead of template plugin