Home › Forums › General Issues › Select men on page editor and show children of that page › Reply To: Select men on page editor and show children of that page
Hi @ussailing
This is a very complex request and not one that I can fully code for you.
You can use a post_object field to select a post. Then, in your template, you can display the child page links with the following code:
<?php
$selected_post = get_field('selected_post');
wp_list_pages( array(
'child_of' => $selected_post->ID
));
?>
ref: http://codex.wordpress.org/Function_Reference/wp_list_pages
You will need to write your own logic to determine if no children exist.
hope that helps.
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.