/** * Include the page content template * @param ACFPost $page The WP_Post for the page wrapped in ACFPost object. */ function tpl_content_page($page) { $has_sidebar_content = page_has_family_tree($page); tpl('content', 'page', array('page' => $page, 'has_sidebar_content' => $has_sidebar_content)); }
<?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); $page = new ACFPost($post); ?> <?php tpl_content_page($page); ?> <?php if (page_has_family_tree()) { tpl_nav_page_tree($page); } ?> <?php } ?> <?php } ?> <?php get_footer();