<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KAPISH::Blog &#187; Posts/Pages from different blogs</title>
	<atom:link href="http://www.jayminkapish.com/tag/postspages-from-different-blogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jayminkapish.com</link>
	<description>About Me and Wordpress</description>
	<lastBuildDate>Wed, 14 Jul 2010 18:51:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress MU: get posts/pages from different blogs under same installation</title>
		<link>http://www.jayminkapish.com/2009/12/11/wordpress-mu-get-posts-pages-from-different-blogs-under-same-installation/</link>
		<comments>http://www.jayminkapish.com/2009/12/11/wordpress-mu-get-posts-pages-from-different-blogs-under-same-installation/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 15:58:43 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Posts/Pages from different blogs]]></category>
		<category><![CDATA[Wordpress Loop]]></category>
		<category><![CDATA[wordpress-mu]]></category>

		<guid isPermaLink="false">http://www.jayminkapish.com/?p=205</guid>
		<description><![CDATA[How can you create a loop to get posts/pages from different blogs under same MU installation?
1) you can use switch_to_blog function
http://codex.wordpress.org/WPMU_Functions/switch_to_blog
2) create wordpress loop (this will get posts from the blog you just switched)
3) do whatever you want with data
4) restore current blog you are on so everything runs after this code go to the [...]]]></description>
			<content:encoded><![CDATA[<p>How can you create a loop to get posts/pages from different blogs under same MU installation?</p>
<p>1) you can use switch_to_blog function<br />
<a href="http://codex.wordpress.org/WPMU_Functions/switch_to_blog">http://codex.wordpress.org/WPMU_Functions/switch_to_blog</a></p>
<p>2) create wordpress loop (this will get posts from the blog you just switched)</p>
<p>3) do whatever you want with data</p>
<p>4) restore current blog you are on so everything runs after this code go to the blog it supposed to<br />
<a href="http://codex.wordpress.org/WPMU_Functions/restore_current_blog">http://codex.wordpress.org/WPMU_Functions/restore_current_blog</a></p>
<div class="phpcode"><code>switch_to_blog(1); // we are switching to blog id # 1<br />
query_posts('showposts=5'); //this would get top 5 posts from blog id # 1. you can change the loop to the get posts from x category<br />
if (have_posts()) :<br />
while (have_posts()) : the_post();<br />
//do whatever you want with data here...<br />
endwhile;<br />
endif;<br />
restore_current_blog();<br />
</code></div>
<h3>Related Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2009/10/08/wordpress-mu-site-upgrade-bug-your-server-may-not-be-able-to-connect-to-blogs-running-on-it/" title="Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it">Wordpress MU Site Upgrade Bug: Your server may not be able to connect to blogs running on it (3)</a></li><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (19)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2009/12/11/wordpress-mu-get-posts-pages-from-different-blogs-under-same-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.jayminkapish.com @ 2010-07-30 06:19:38 by W3 Total Cache -->