WordPress Multisite footer navigation

On a new project I wanted to have an footer navigation across a range of WordPress Multisite blogs. This is my solution:

<?php $current_blog = get_current_blog_id(); ?>
<?php switch_to_blog(1); ?>
<ul>
<?php wp_list_pages( 'show_home=1&title_li=<h3>'.get_bloginfo('name').'</h3>&depth=1' ); ?>
</ul>

<?php switch_to_blog(2); ?>
<ul>
<?php wp_list_pages( 'show_home=1&title_li=<h3>'.get_bloginfo('name').'</h3>&depth=1' ); ?>
</ul>

...

<?php switch_to_blog($current_blog); ?>

If you use switch_to_blog just once you don’t need the $current_blog and you can switch back easy using restore_current_blog().

WordPress Function Reference / switch to blog

The project URL is coming soon.