Created
January 26, 2012 19:02
-
-
Save ramseyp/1684396 to your computer and use it in GitHub Desktop.
WordPress - list only direct children pages, not all levels of child pages
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 | |
/* List only child pages of a page - not grandchildren | |
*/ | |
?> | |
<ul class="clearfix"> | |
<?php wp_list_pages( array('title_li'=>'','include'=>get_post_top_ancestor_id()) ); ?> | |
<?php wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>get_post_top_ancestor_id()) ); ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment