So, on my wordpress site I have page called "Books" and sub-pages, each containing info about some book.
It looks something like this:
- Books
- Harry Potter, J.K.Rowling
- Some Other Book, Who WroteIt
- Some Other Book, Who WroteIt
- Some Other Book, Who WroteIt
What I want to do is create custom page template for "Books" page which will list all sub-pages. I managed to find this:
<div id="submenu">
<ul>
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<?php echo $children; ?>
<?php } ?>
</ul>
</div>
Wich does the job but how could I create template which is going to use some more information about the book. i.e. book title, book cover picture, and some other information created with custom fields.
I'm not sure if I explained this right so I'll try to sketch it.
This is what I am trying to get with page template for Books page:
Red text shows type of content that needs to be "pulled" from sub-pages.