<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Global page navigation accross WordPress MU blogs</title>
	<atom:link href="http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/</link>
	<description>On Technology &#38; Entrepreneurship</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:29:01 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Samuel Sirois</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-493</link>
		<dc:creator>Samuel Sirois</dc:creator>
		<pubDate>Thu, 29 Jul 2010 23:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-493</guid>
		<description>Thank you very much for this code. Works great in WP3.

I&#039;ve slightly updated the code since CK&#039;s version of URL replacement was still hard-coded stuff, (&lt;a href=&quot;http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-266&quot; rel=&quot;nofollow&quot;&gt;see CK&#039;s array solution to URL replacement problem&lt;/a&gt;) and won&#039;t work fluently when an administrator can add sites that were not there at first release.

Here is a little trick that worked for me:

&lt;code&gt;
switch_to_blog(1);
$mainSiteURL = get_bloginfo(&#039;url&#039;);
restore_current_blog();
$output = str_replace(get_bloginfo(&#039;url&#039;), $mainSiteURL, $output);
&lt;/code&gt;

Of course, you don&#039;t want to switch blog twice, but that&#039;s basically what would work in a generic way.

Thanks to &lt;a href=&quot;http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-267&quot; rel=&quot;nofollow&quot;&gt;Felipe Navarro V. comment&lt;a&gt; for pointing out the switch_to_blog function.</description>
		<content:encoded><![CDATA[<p>Thank you very much for this code. Works great in WP3.</p>
<p>I&#8217;ve slightly updated the code since CK&#8217;s version of URL replacement was still hard-coded stuff, (<a href="http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-266" rel="nofollow">see CK&#8217;s array solution to URL replacement problem</a>) and won&#8217;t work fluently when an administrator can add sites that were not there at first release.</p>
<p>Here is a little trick that worked for me:</p>
<p><code><br />
switch_to_blog(1);<br />
$mainSiteURL = get_bloginfo('url');<br />
restore_current_blog();<br />
$output = str_replace(get_bloginfo('url'), $mainSiteURL, $output);<br />
</code></p>
<p>Of course, you don&#8217;t want to switch blog twice, but that&#8217;s basically what would work in a generic way.</p>
<p>Thanks to <a href="http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-267" rel="nofollow">Felipe Navarro V. comment</a><a> for pointing out the switch_to_blog function.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felipe Navarro V.</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-267</link>
		<dc:creator>Felipe Navarro V.</dc:creator>
		<pubDate>Thu, 20 May 2010 06:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-267</guid>
		<description>Thanks, was very useful. Perhaps you better use:
&lt;code&gt;
  switch_to_blog(1);
  $pages = get_pages($args);
  restore_current_blog();
&lt;/code&gt;

instead of

$wpdb-&gt;set_blog_id(1);</description>
		<content:encoded><![CDATA[<p>Thanks, was very useful. Perhaps you better use:<br />
<code><br />
  switch_to_blog(1);<br />
  $pages = get_pages($args);<br />
  restore_current_blog();<br />
</code></p>
<p>instead of</p>
<p>$wpdb-&gt;set_blog_id(1);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CK</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-266</link>
		<dc:creator>CK</dc:creator>
		<pubDate>Mon, 17 May 2010 22:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-266</guid>
		<description>For all above who where having problems with the sub directories. I added an array of all my sub blogs and then removed them all with the string replace. See $blogs = array below

// This line is sloppy and needs improvement.
	// You have to remove the name of the blog your currently on from you global navigation.
	// I&#039;m doing this the simplest but least scalable way here.

	$blogs = array(&quot;music/&quot;, &quot;action-sports/&quot;, &quot;new-releases/&quot;,&quot;stuff-we-like/&quot;);
	$output = str_replace($blogs, &quot;&quot;, $output);

	if ( $r[&#039;echo&#039;] )
		echo $output;
	else
		return $output;
}</description>
		<content:encoded><![CDATA[<p>For all above who where having problems with the sub directories. I added an array of all my sub blogs and then removed them all with the string replace. See $blogs = array below</p>
<p>// This line is sloppy and needs improvement.<br />
	// You have to remove the name of the blog your currently on from you global navigation.<br />
	// I&#8217;m doing this the simplest but least scalable way here.</p>
<p>	$blogs = array(&#8220;music/&#8221;, &#8220;action-sports/&#8221;, &#8220;new-releases/&#8221;,&#8221;stuff-we-like/&#8221;);<br />
	$output = str_replace($blogs, &#8220;&#8221;, $output);</p>
<p>	if ( $r['echo'] )<br />
		echo $output;<br />
	else<br />
		return $output;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ecenica</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-265</link>
		<dc:creator>Ecenica</dc:creator>
		<pubDate>Sat, 01 Aug 2009 14:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-265</guid>
		<description>Maybe I spoke too soon? This doesn&#039;t seem to work for subdomain WPMU&#039;s does it? - Am I missing something?</description>
		<content:encoded><![CDATA[<p>Maybe I spoke too soon? This doesn&#8217;t seem to work for subdomain WPMU&#8217;s does it? &#8211; Am I missing something?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ecenica</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-264</link>
		<dc:creator>Ecenica</dc:creator>
		<pubDate>Sat, 01 Aug 2009 13:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-264</guid>
		<description>Great bit of code. Searched WPMU Forum without success and came across your code. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>Great bit of code. Searched WPMU Forum without success and came across your code. Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Teleogistic / Making Sitewide Tags work</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-263</link>
		<dc:creator>Teleogistic / Making Sitewide Tags work</dc:creator>
		<pubDate>Mon, 20 Jul 2009 16:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-263</guid>
		<description>[...] those changes manually to the tags blog. A bit of Googling led me to a solution. Dusty Reagan wrote a function that he calls wp_list_main_pages that pulls the navigation dynamically from the main site blog onto any other blog on the site. [...]</description>
		<content:encoded><![CDATA[<p>[...] those changes manually to the tags blog. A bit of Googling led me to a solution. Dusty Reagan wrote a function that he calls wp_list_main_pages that pulls the navigation dynamically from the main site blog onto any other blog on the site. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Making Sitewide Tags work - CUNY Academic Commons Development Blog</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-262</link>
		<dc:creator>Making Sitewide Tags work - CUNY Academic Commons Development Blog</dc:creator>
		<pubDate>Mon, 20 Jul 2009 16:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-262</guid>
		<description>[...] those changes manually to the tags blog. A bit of Googling led me to a solution. Dusty Reagan wrote a function that he calls wp_list_main_pages that pulls the navigation dynamically from the main site blog onto any other blog on the site. [...]</description>
		<content:encoded><![CDATA[<p>[...] those changes manually to the tags blog. A bit of Googling led me to a solution. Dusty Reagan wrote a function that he calls wp_list_main_pages that pulls the navigation dynamically from the main site blog onto any other blog on the site. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyrael</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-261</link>
		<dc:creator>Tyrael</dc:creator>
		<pubDate>Tue, 26 May 2009 18:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-261</guid>
		<description>Just what I was looking for! However, I have the problem that my WPMU install uses subdirectories instead of subdomains, and I need the page link to point to the page on the main site. Currently, it links to the page of the current sub-site (which doesn&#039;t exist).


The link I want: domain.com/page
The link I am getting: domain.com/subsite/page</description>
		<content:encoded><![CDATA[<p>Just what I was looking for! However, I have the problem that my WPMU install uses subdirectories instead of subdomains, and I need the page link to point to the page on the main site. Currently, it links to the page of the current sub-site (which doesn&#8217;t exist).</p>
<p>The link I want: domain.com/page<br />
The link I am getting: domain.com/subsite/page</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scott bothel</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-260</link>
		<dc:creator>scott bothel</dc:creator>
		<pubDate>Fri, 22 May 2009 16:19:33 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-260</guid>
		<description>Great work. It inspired a solution (hack) to my problem of wanting to display a global menu controlled by the bookmarks list of the main blog.
Problem: once defining the current site as ID 1, I can&#039;t get it to go back to the actual current site to display the user&#039;s own bookmarks list. How do I get the real ID back?
&lt;code&gt;global $wpdb;
			$wpdb-&gt;set_blog_id(1);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Great work. It inspired a solution (hack) to my problem of wanting to display a global menu controlled by the bookmarks list of the main blog.<br />
Problem: once defining the current site as ID 1, I can&#8217;t get it to go back to the actual current site to display the user&#8217;s own bookmarks list. How do I get the real ID back?<br />
<code>global $wpdb;<br />
			$wpdb-&gt;set_blog_id(1);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL Tutorials</title>
		<link>http://dustyreagan.com/global-page-navigation-accross-wordpress-mu-blogs/comment-page-1/#comment-259</link>
		<dc:creator>SQL Tutorials</dc:creator>
		<pubDate>Fri, 01 May 2009 02:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://dustyreagan.com/?p=72#comment-259</guid>
		<description>Does anyone know if there is another language or set of commands beside SQL for talking with databases?

I&#039;m working on a project and am doing some research thanks</description>
		<content:encoded><![CDATA[<p>Does anyone know if there is another language or set of commands beside SQL for talking with databases?</p>
<p>I&#8217;m working on a project and am doing some research thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
