How to handle parent and child pages?
Problem 2: displaying the 3 panels. Do I set these up as individual children elements? If so, how can I style each one differently as it loops through?
There are only 3 items. Don’t loop through them. Use get_posts()
to place them in an array and then step through each array item:
$panels = get_posts( array() );
Fill the array()
with the arguments to get those posts. Now $panels is an array of post objects. Step through them:
// First panel
// Do stuff with $panels[0]
// Second panel
// Do stuff with $panels[1]
// Third panel
// Do stuff with $panels[2]
To set up the post for use with Template Tags, use the setup_postdata()
WordPress function. For example, to echo the post content for the first panel use something like this:
global $post;
// First panel
// Do stuff with $panels[0]
$post = $panels[0];
setup_postdata( $post );
echo the_content;
After all posts are done reset the from the main query:
wp_reset_postdata();
See setup_postdata()
and wp_reset_postdata()
for more examples and explanations.
For post thumbnails, read the codex article on Post Thumbnails for settings, details and examples.