I am trying to create single page theme.
What i have trouble with is understanding this whole wordpress query logic.
There is query object and supposedly i get all published posts like this:
$query = new WP_Query( array (
'orderby' => 'menu_order',
'order' => 'ASC',
'post_type' => array( 'page' ),
'post_status' => array( 'publish' ) ) );
and can loop over them like this :
while ( $query->have_posts() ) {
$query->the_post();
echo '<li>' . the_title() . '</li>';
}
But then what? I cant even figure out that codex - where are all the functions of post object that i can use? Like the_title()? Where is that in codex?
What i want to achieve seemed pretty simple and straightforward - load all pages with nested subpages and then just print them out on single page similar to the loop above... But this codex is driving me crazy :P
But is this even best approach? Should i be defining my query somewhere else (as opposed to index.php like im doing now)? Should i be somehow using wordpress original page loading which displays pages using their templates (if they have one) or using something similar to content-page.php like the one that default themes have?
Alan