Adding a_foreach_page() function