Created
February 24, 2013 07:12
-
-
Save dionysia/5022978 to your computer and use it in GitHub Desktop.
Get Wordpress child pages of current page and echo them as links
This file contains hidden or 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 | |
$pages = get_pages('child_of='.$post->ID.'&sort_column=post_title'); | |
$count = 0; | |
foreach($pages as $page) | |
{ ?> | |
<a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment