Shared Navigation in WordPress MU

I am working on my first serious WordPress MU installation in a couple of years, and I came across an interesting question:  How do I use the main home page navigation across all blogs?  Basically, I need the main navigation to be the same on every blog.

After some research, I came upon this discussion thread on the WordPress forums.  In the thread, you will see all sorts of different solutions proposed from plugins to hooks.  The simplest solution that I found is to include the following in your sub-blog’s “header.php” file:

<?php switch_to_blog(1); ?>
<?php wp_list_pages('title_li='); ?>
<?php restore_current_blog(); ?>

This code temporarily switches back to the main blog’s information, pulls the main navigation, then switches back to the current blog.  Pretty nifty!

Posted in ,

2 Comments

  1. Carl on September 18, 2009 at 8:32 pm

    Wow. That function could open up a number of possibilities for cross blog sharing. Good tool for the toolbox.

    I was actually trying to find a way to do that on an install recently (without hard coding the page urls)

    Thanks



  2. Toby on September 21, 2009 at 8:58 pm

    @Carl – Glad to be of service. 🙂



RSS From Toby’s Blog

  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you.
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]
  • What content should I put on my homepage?
    I see websites as one stop of many on the sales journey, useful to help get customers from Point A to Point B in the sales process (or maybe from Point D to Point E).  If you are wondering about what to put on your homepage, start with these basic sales-related questions: Who, specifically, will…

More posts from themightymo.com

We Now Offer Search Engine Optimization!

By | February 2, 2009

We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…

Adobe CS4 Flash MN Presentation at FlashMN

By | October 14, 2008

Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer.  The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards.  So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100).  There are…

SPECIAL OFFER: $99 WordPress Blog!

By | July 19, 2008

For the Month of July only! Get your very own WordPress blog or static website – $99! This includes: – Domain registration for one year – Hosting for one year – Installation of your WordPress blog – Installation of SEO plugin, Akismet spam prevention, and up to 5 additional plug-ins of your choosing – Online…

RSS From Toby’s Blog

  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you.
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]
  • What content should I put on my homepage?
    I see websites as one stop of many on the sales journey, useful to help get customers from Point A to Point B in the sales process (or maybe from Point D to Point E).  If you are wondering about what to put on your homepage, start with these basic sales-related questions: Who, specifically, will…