Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Specifying the surrounding page template in 1.7 to allow different templates for BP content

@r-a-y

Keymaster

or am I over thinking this?

Hugo, my answer was towards Roger’s question about having different areas on the external page template based on his requirements. It’s not meant to be a page router for everything as BP already does that.

Example: Like Roger, I want to have a sidebar on member profile pages only.

I don’t want to let BuddyPress use the `page.php` template as a default, so I’ll create a template file called `plugin-buddypress.php`.

BuddyPress will use `plugin-buddypress.php` instead of `page.php` for the skeleton. Like `page.php`, this new template file will need to include “ somewhere in the template as that is what BP looks for to inject our content.

Now, I only want to enable a sidebar for member profiles only.

So somewhere in `plugin-buddypress.php`, I’ll do something like this:

`<?php
// are we on a user profile page? if so load up our special members sidebar
if ( bp_is_user() ) :
get_template_part( ‘my-special-members-sidebar’ );
?>`

This will enable me to show a different sidebar on a user profile page only.

Skip to toolbar