Archived topic
Code to list child pages of a parent page
3 replies · Started by Matthew on February 21, 2020
Hi,
Copied the template for pages (page.php and content-page.php) into my child theme.
Renamed them to page-faq.php and faqcontent-page.php.
Tried to place this code into both above at various locations:
<?php wpb_list_child_pages(); ?>
But get whitescreen.
I am trying to do this:
Can this code work?
thanks,
Hi there,
can't see an issue with the code - maybe worth testing the shortcode they provide on a standard Page with children. If that works then the code is good and the problem is with the child templates you have defined.
May i ask whats the need for the faq template ? Does it differ from a standard page
good question about the template,
I was going to ask, can I simply copy the template for pages (page.php and content-page.php) into my child theme. So not rename them to page-faq.php and faqcontent-page.php.
Then I can put the code in them and it will override the template in the parent theme?
thanks,
Thats correct but maybe using a Hook element to display the Child Page list where you need it would be simpler:
https://docs.generatepress.com/article/hooks-element-overview/