WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating new pages under Pages > Add new.

And creating my own page.php file from the ground up, what's the best way of displaying pages contents?

I guess not get_template_part( 'loop'), since there will be no posts, just static pages?

share|improve this question
up vote 0 down vote accepted

Actually, pages also use the loop to display contents, but there will only be one "post" to loop through. Pages are treated almost exactly the same way as single posts as far as reading and rendering content goes.

If you're creating your own page.php file for a theme, take a look first at how Twenty Ten is put together. It's always easier to learn from others than to reinvent the wheel.

share|improve this answer
I hope all will work fine, because there will be some nested loops as I want to display for example list of portfolio items on my page. Going to accept your answer in 3 minutes btw :) Thanks for help, Twenty Ten was very helpful. – Wordpressor Feb 24 '11 at 21:25
If you have multiple loops, you might want to reference the Codex articles that have several examples of multiple loops in action. – EAMann Feb 24 '11 at 21:51
thank you! – Wordpressor Feb 24 '11 at 21:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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