Welcome to the BlueLayerMedia Web Development Blog

We don't just build blogs, we write them too. Take a look at what's going on and our senseless ramblings!

BuddyPress: How To Use A Different Theme

By: on Nov 11, 2009 | 1 Comment

buddypress-logo

We’ve done quite a bit of work with WordPress with our clients such as designing themes, creating themes from .psd’s, making plugins and more. Working with the BuddyPress plugin was something completely new to us. It presented a few challenges which we thought we would share with you in the hopes we save you some frustration and time.

The Scenario: Our client wanted to have BuddyPress (BP) installed on his WordPressMU site to add additional social functionality. They wanted to have the main WordPressMU site have its own theme (blogging related) and the social (BP) side of their site have a completely different look and feel, yet have them be integrated in to each other.

The installation of BP was as straightforward as any other plugin. Upload and activate. So far so good. Now it was time to give BP its own look. BP came with its own default theme and at first glance it had all the needed functionality we needed. We would be changing some of the layout/theme down the road later anyway. We activated the default BP theme and looked at the social side of the site. It was perfect and it functioned well. We went back to the main site and to our surprise and dismay, the main site had taken on the default BP theme, rendering the main site utterly useless.

We dug around on Google and the official BuddyPress forums and found in the latest version of BuddyPress (1.1.2) there is no support for it to use a different theme than the main site or vice versa. Instead what we were reading is we were going to have to copy the default theme, and in essence modify it and create our own theme. The other option was to copy the main site’s theme, add some of the BP functionality to it, call BP’s CSS and presto, BP would adopt the main site’s theme and would just need “minimal” CSS work to get it to look right. After trying that and seeing there was much more than minimal CSS work to be done, that idea was thrown out.

The Fix: What we decided to do is create another blog on the main WPMU site. We named it to social and set this particular blog’s theme to the BP default. Now we had the main site with its original theme and the social site with its default BP theme. What was lacking was an integration in between them. Here’s how we did it. blog id

In the WPMU admin area, under Site Admin, open the blogs tab and note the blog id of the blog you are using for the BP side of things. As you can see in the image to the right, there is an ID column and in this case the blog id for us was #9.

Next, open up your wp-config.php file. Don’t worry, you’ll be making a very small change and won’t be adding lines of endless code.

Around line #45 you should see something like this: define( ‘BP_ROOT_BLOG’, 9 );

Set the BP_ROOT_BLOG to whatever id number you found in your WPMU admin. This tells WordPress what blog to use for the default BP functions. Save, upload and overwrite your original file. Refresh your main site and try the nav links in the admin bar now. That’s right, they work and link to the social blog you created.

This was by far the easiest and most time saving way for us to accomplish what we were after. The downside is it added an additional url slug to links on the social side. A very minimal downside indeed.

BuddyPress definitely opens to the door to making your WPMU more feature rich and giving your users more to do on your site. Our personal impressions and initial thoughts are it still has a bit of growing and development to take place to make it easier to work with. Not having the ability out-of-the-box to use a different theme is something I hope is changed in future developments.


No related posts.

Comments (1)

Roi

Posted at 1:38 pm on December 19th, 2010

Thanks for sharing!
But the problem is, since the WordPress 3 is now integrated with the former MU features, the method of setting two WordPress and link the Buddypress via wp-config is no longer available, any new ideas?

Post a Comment