开发者

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.


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

Where category id 1 is your SuperCool App Category

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜