loop through ZenPage Pages

Is there any way to loop through the ZenPage Pages?

I would like to print a list of Pages with title, date and content with 'read more' links when visiting the directory /zenphoto/pages/
Like when you do a search for a Page title.

I have found the next_page function but it seems only for search purposes.
In my theme's pages.php

`
// if there is no content it means we are looking at a blank pages.php
if (!getPageContent()) {
while (next_page()) : ;
endwhile;
}
`

Comments

  • You will have to use the object model for this. The zenpage class has a method `getPages()` to return the database rows for all the pages. You would have to instantiate a page object for each within your loop.
  • getPages()
    Okay, that was very helpful!
    Cheers :-)
Sign In or Register to comment.