How to share links among WordPress MU Blogs

We have recently started using WordPress MU to manage several blogs related to the products, technologies and practices on which we provide training.  I was looking for an easy way to link these blogs to each other in the sidebar without managing the links separately in each blog.

I found the easiest way was to modify the source code in the theme.  Here’s the solution I came up with:

  1. Open /wpmu/[version]/wp-content/themes/[your_theme]/sidebar.php in your editor.
    1. [version] = your version of WordPress (e.g, 2.9.2)
    2. [your_theme] = the them your using (e.g, coogee)
  2. Search for wp_list_bookmarks();
  3. Add the following code beneath that line:
    global $blog_id;
    if ($blog_id != 1)
    	global $switched;

The Result

Each blog will show their own links (i.e, the ones you add in via their specific admin pages) followed by the links added to the main blog ($blog_id==1).

The only downside I see is that this doesn’t allow for links specific to your main blog. I expect it wouldn’t be hard to modify the code to only list bookmarks from a certain category though. Anyone want to take a stab at that?

Get the latest updates on our blog, classes, and tutorials by subscribing to our free newsletter. Click here to sign up.

About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Check out our complete course catalog.