WPMU Functions/switch to blog

来自WordPress中文文档
Zhuozuran讨论 | 贡献2009年3月14日 (六) 09:29的版本 (1个修订)
跳转至: 导航搜索

To pull posts from another blog id on a Wordpress MU site, put switch_to_blog($id); before your loop where $id is the blog ID of the blog from which you want to query posts.

At the end of the loop, put restore_current_blog();