WordPress.org

Forums

Display single page or child pages from one template file (2 posts)

  1. katart17
    Member
    Posted 4 years ago #

    I was looking to use a single-posttype.php to display a single page or a list of Child pages. After a couple hours of testing I came up with the following code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Is there a more efficient way of writing this code?

    Thanks

  2. katart17
    Member
    Posted 4 years ago #

    I recently modified it to work when a Post has no Child pages.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can this be streamlined?

Topic Closed

This topic has been closed to new replies.

About this Topic