Created
August 7, 2018 23:56
-
-
Save ammist/189c409c02d931559c31300afddd982c to your computer and use it in GitHub Desktop.
Show Child Pages on Genesis (Page Template)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Template Name: Section Landing Children */ | |
function tl_show_page_children(){ | |
// get the child pages | |
global $post; | |
$args = array( | |
'sort_order' => 'ASC', | |
'sort_column' => 'menu_order', | |
'hierarchical' => 0, | |
'parent' => $post->ID | |
); | |
$child_pages = get_pages($args); | |
foreach ($child_pages as $p){ | |
$post = $p; | |
setup_postdata( $post ); | |
/* Do a better job formatting this! */ | |
the_title(); | |
the_excerpt(); | |
} | |
} | |
add_action('genesis_loop', 'tl_show_page_children', 100); | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment