How to search multiple blogs in one installation, and have one home page
-
Introduction
I have multiple sub-blogs in WP 3.0 on the same domain. In this installation I wanted visitors to be able to search the content of all sub-blogs from one search form, as well as have a front page where the posts from the different sub-blogs are shown.
Plugin Used
WordPress MU Sitewide Tags Pages
Steps followed
1. In ‘Super Admin’ -> ‘Options’ enable ‘Tags Blog’.
2. In ‘Super Admin’ -> ‘Options’ at ‘Tags Blog’ set the ‘Blogname’ to: home
3. In ‘Super Admin’ -> ‘Sites’ write down the link for the ‘home’ blog
4. In your navigation change the home URL to the link in 3. For example:Main Menu
- Home = https://www.yourdomain.com/home
- Fruit Blog = https://www.yourdomain.com/fruit_blog
- Vegetable Blog = https://www.yourdomain.com/vegetable_blog
5. In your search form(s) change the form method action to the home URL in 3. For example:
<form method="get" class="searchform clearfix" action="https://www.yourdomain.com/home/"> <input type="text" value="<?php if ('' == get_search_query()) { _e('Search...', 'arras'); } else { the_search_query(); } ?>" name="s" class="s" onfocus="this.value=''" /> <input type="submit" class="searchsubmit" value="<?php _e('Search', 'arras') ?>" title="<?php printf( __('Search %s', 'arras'), wp_specialchars( get_bloginfo('name'), 1 ) ) ?>" /> </form>
6. Repeat steps 4. and 5. for all sub-blogs (that have different themes) that you want to refer to the home blog.
You should now have a common home page where all the articles of your sub-blogs will be shown. As well as all search queries will run through the main blog, regardless of which sub-blog you’re on.
Left to solve
So far I have only gotten newly added posts to show in the ‘home’ blog. Does anyone know how to add the older posts?
Reference
Search across multiple blogs 1
Search across multiple blogs 2
- The topic ‘How to search multiple blogs in one installation, and have one home page’ is closed to new replies.