Last active
March 12, 2018 05:42
-
-
Save braddalton/45d27d46ae79e3500184d3fbfd996700 to your computer and use it in GitHub Desktop.
List Sub/Child Pages Of a Parent Page & Exclude Grand Children in Genesis https://wp.me/p1lTu0-hoi
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 | |
/** | |
* @author Brad Dalton | |
* @link https://wp.me/p1lTu0-hoi | |
*/ | |
// Template name: Child Pages | |
add_action( 'genesis_after_entry', 'child_pages', 1 ); | |
function child_pages() { | |
$children = wp_list_pages( array( | |
'child_of' => get_the_ID(), | |
'depth' => 1, | |
'title_li' => '', | |
'sort_order' => 'asc' | |
) ); | |
if ( $children) : ?> | |
<ul> | |
<?php echo $children; ?> | |
</ul> | |
<?php endif; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment