Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to load specific theme template for all BP pages?


  • r083r7
    Participant

    @r083r7

    Hello BuddyPress community,

    I would like to know how could I have a specific theme template load for all BP pages.
    I created a theme template called “buddypress” (just a couple of changes to the header) and I would like this new template to load for BP.

    Any ideas on how to make this happen?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You’ll probably need to be a little more specific as to what you have done and are looking to control. BP provides many paths to custom styling you can create a child theme and then copy various BP templates or the stylesheets to it to modify, or you can create a new buddypress.php template from the themes page.php and redefine the get_template calls for header or footer so new unique ones are called when BP screens are being shown.

    The BP codex has all these details, have a hunt through the theme section and a read of the template hierarchy to learn how you can introduce new template parts.

    But re-state what you’re trying to do in a little more detail as we may be able to give better suggestions on how to achieve.


    r083r7
    Participant

    @r083r7

    OK fair enough. I did look through the BP codex regarding this and am still unclear what is the best and easiest path.

    My site is basic and includes the Header, Content, and Footer. I am using Genesis theme and created another template where I make several adjustments to the Header and this template is called buddypress.php and I can select it when I’m in the backend and creating pages. I’m sure there are many paths but I was thinking that the easiest one is to simply have BP load the new template I created, for all BP pages. I’m pretty sure currently it is loading the themes template called “pages.php”

    Please point me in the right direction, much appreciated.

    @r083r7 Hi. You’re right that BuddyPress loads page.php as its default page wrapper template. The list near the top of https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/ shows the entire template hierarchy. Adding a buddypress.php file to your theme should have it load that template.

    This file should be in the root of your theme, or inside a subfolder called “buddypress”.

    I forget how setting the page template in the wp-admin page editor works with BuddyPress (I think @hnla and I fixed it at a WordCamp a few years ago). But the stuff already mentioned will probably take precedence over it.

    If this doesn’t work, I’m not sure.


    r083r7
    Participant

    @r083r7

    I must be missing something basic.

    Just to clarify this is the correct location:
    wp-content>themes>genesis-sample>buddypress.php

    genesis-sample is the child theme by the way.


    r083r7
    Participant

    @r083r7

    Well that was strange.

    I deactivated all my plugins except for BuddyPress. Then activated them all again. WORKS !!!

    If anyone has any theories as to why it worked it would be nice to know.


    danbp
    Participant

    @danbp

    @r083r7,
    glad you got it to work ! 😉
    Not sure if it is a theory or simply how it works, but deactivating/reactivating (plugins, themes) will in most case recalculate the permalinks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar