ahainen
ahainen

Reputation: 796

How to pull related posts within WordPress post?

I am building a WordPress theme for a small startup. They want to have a post about one of their projects, i.e. SuperCool App. It is it's own post.

Then, they want to have at the bottom "News Updates" about that post, which each News Update would be it's own post as well.

My problem is, in "SuperCool App" post, how can I put a loop that only pulls News Updates for SuperCool App, not News Updates for other projects?

I'm editing single.php in WordPress 3.1.2.

Upvotes: 0

Views: 140

Answers (1)

Danzan
Danzan

Reputation: 968

 $posts = get_posts(array('numberposts' => 10000, 'category' => 1));

Where category id 1 is your SuperCool App Category

Upvotes: 1

Related Questions