-1

I want to list episodes of a series I am making of instructional videos with content.

The patent page "series" will list episodes weekly. Ie: episodes 1, 2, etc.

I'm thinking to setup a template to loop through the series parent page to display the episodes children content in a loop.

Then on each series page there will be 3 panels. A long one with the video and other episodes thumbnails, one on the left and one on the iught with content.

Just trying to work out how to display the children > children post content as above.

Problem 1: displaying related thumbnails to other children?

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?

Any code examples would be amazing! Unless there's a plugin for this?

Thanks!

0

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.

  • Thanks so much @charlesclarkson. Exactly what I needed. Can you also update the answer to show how I would get the post content with each object? And how can I display the thumbnails of each other child>child in the sidebar? Thank you again! – DT.DTDG Sep 10 '13 at 18:41
  • See the edit above. – Charles Clarkson Sep 11 '13 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.