Last active
December 31, 2015 11:39
-
-
Save tommaitland/7981110 to your computer and use it in GitHub Desktop.
Basic subpage listing in WordPress
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 | |
// List subpages on parent and child page. Outputs ul > li. | |
$child_of = ($post->post_parent > 0) ? $post->post_parent : $post->ID; | |
if ($child_of > 0 && is_page()) { | |
wp_list_pages('title_li=&child_of='.$child_of); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment