How can I loop through posts as well as child pages to display them all by date in Wordpress 2.9

Posted by Craig Dennis on Stack Overflow See other posts from Stack Overflow or by Craig Dennis
Published on 2010-04-02T01:25:54Z Indexed on 2010/04/02 1:33 UTC
Read the original article Hit count: 406

Filed under:
|
|
|
|

Some background info --

In wordpress I have my portfolio as a parent page with each item of work a child page. I also have a blog.

I want to display the most recent 6 items on the homepage whether they are from my portfolio or my blog.


I have a loop that displays the posts and on another page I have a loop that displays the child pages of a specific parent page. I only need to display the_title and the_post_thumbnail.

Is it possible to loop through both the posts and the child pages and display them in order of date (recent first).

So the final display would be a mixture of posts and child pages.

Could it be done by having a separate loop for pages and one for posts, then somehow adding the results to an array and then pull them out in date order (recent first).

Any help would be greatful.

Thanks

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about loop