Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
1  
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
add comment

Your Answer

 
discard

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.