Quick Tip: Display Excerpts of Child Pages with a Shortcode
February 14, 2012 — Code
Sometimes we have a page just for the sake of making it a parent of other pages. I’ve even seen these pages left blank! You should at least have a small paragraph for the sake of search engines and visitors alike, but what about also offering a snippet of the subpages to read similar to how your blog page does posts?
In this quick tip, we’ll create a little function that will query the page for child pages, display titles, excerpts and links if it finds any, and add it to a shortcode for use from the WordPress page editor.