Navigation Shortcut Links to Switch Blog For WordPress MU

by Kishore on January 31, 2010

In WordPress MU when you have multiple blogs and often want to go the same page of all the blogs, we either need to edit the URL or switch blog. I just thought of writing a simple hack to switch blogs to the same page. For example you are on the plugins page of the main blog and you want to go to the same plugins page of another blog, how do you go?
  1. Edit the URL with the blog name
  2. Go to blogs link and then backend and then the page you want to go.

Are there any other way, I don’t know, let me know how do you do that?

My hack

I just created a simple hack which adds up links on top of every admin page

Just click on the link, you will be taken to the same page of that particular blog

The Code

// You can add this code to the functions.php of your <a href="http://kish.in/AffiliateTheme" style="color:#666666;text-decoration:underline;" target="_blank" rel="nofollow" onmouseover="self.status='http://kish.in/AffiliateTheme';return true;" onmouseout="self.status=''">theme</a> or create a small hack plugin
function kish_global_link() {
$page=$_SERVER['PHP_SELF'];
// getting the page with the query string if any of the current page
$page.=strlen($_SERVER['QUERY_STRING']) ? "?".$_SERVER['QUERY_STRING']:"";
global $blog_id;
$blogs=kish_mu_get_blogs();
echo "<div align="center" style="font-size:16px;font-weight:bold">";
//loop through all the blogs, the current blog will be escaped
foreach($blogs as $blog): ?>

<?php echo "<a>siteurl.$page."\">".$blog_details->blogname."</a> | "; ?>

<?php endforeach;
echo "</div>";
}
// add the action admin notices
add_action('admin_notices', 'kish_global_link', 1);

You can add this code you your theme functions.php

  1. Managing your affiliate links in WordPress : You may have joined different affiliate...
  2. WordPress Plugin to manage affiliate links : I just installed MaxBlogPress which is...
  3. Adding Intelligent Links To Your Blog Post Images : Links are of great importance on...
  4. Thesis Theme Works With WordPress MU : I recently got thesis theme for...
  5. Delete Link For WordPress Blog : If you looking for adding a...