Skip to:
Content
Pages
Categories
Search
Top
Bottom

is it ok to copy files from bp-templates/bp-legacy/buddypress directory


  • Leo
    Participant

    @wp_new_user

    Hi all,

    I am really confused with bp-templates and bp-themes directories.

    I wanted to change my activities page, more specifically, to add a sentence above the activity posting form.

    I tried editing bp-themes/bp-default/activity/index.php,
    but I couldn’t get what I needed, no changes happened when I added a paragraph to it.

    Later I found another file: bp-templates/bp-legacy/buddypress/activity/index.php,
    and when I added my paragraph to it, I got what I needed.

    In order to leave the BP files without changing, I copied them to my child theme directory: my-child-theme-directory/buddypress/activity/index.php.

    I did this on a test BP install and there was no problem.

    On my real website, I found an activity directory in my child theme’s buddypress folder, which contains an index.php file, when I checked, it is the index.php from bp-themes/bp-default/activity/.

    So, how can I make this without replacing the index.php file?
    Is it wrong to copy and edit files from bp-templates/bp-legacy/buddypress folder?

    Maybe it’s an easy thing, but I am really confused. Please advise me.

    Thanks,
    Leo

Viewing 10 replies - 1 through 10 (of 10 total)

  • shanebp
    Moderator

    @shanebp

    Unless you are explictly using the bp-default theme as your Theme,
    always use these templates bp-templates/bp-legacy/buddypress/

    Re your current activity/index file in your child theme – use the index.php from the bp-legacy location and move any changes you want into that file.


    Hastig
    Participant

    @hastig

    Maybe it’s an easy thing, but I am really confused. Please advise me.

    Well, if it’s easy we’re both dummies cuz I find it extremely confusing myself.

    Take the template for a single members profile page as an example.

    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php

    is to be copied and renamed to your theme, but first you have to rename it to index.php for some reason. like this..

    /wp-content/themes/THEMEFOLDER/buddypress/members/single/index.php

    Or this one which I forget is to either view the inbox or a message thread..

    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single/view.php

    would change to..

    /wp-content/themes/THEMEFOLDER/buddypress/members/single/index-action-view.php

    Some template files are turned
    into ‘actions’, some are to be ‘components’, some files get renamed, some names stay the same but go in different folders than the bp-legacy structure, and so on.

    Here’s a page that can sort of help make sense of it..

    Template Hierarchy


    Leo
    Participant

    @wp_new_user

    @shanebp thank you!


    @hastig
    I didn’t even know it’s this much complicated.


    Hastig
    Participant

    @hastig

    Here’s a partial buddypress template files to theme folder listing here

    I don’t have activity streams activated so I can’t help you with your original problem, though I’m sure you’ve since figured it out.


    Leo
    Participant

    @wp_new_user

    thanks @hastig this is quite a useful list, we may need later
    yes I figured out how to make it on activity stream


    shanebp
    Moderator

    @shanebp

    @wp_new_user

    Keep it simple.

    For example, to overload this file:
    /bp-legacy/buddypress/members/single/profile/edit.php

    Copy it to here:
    /yourtheme/buddypress/members/single/profile/edit.php
    and make your changes.


    Hastig
    Participant

    @hastig

    @shanebp

    I wish the simple way worked for me, nothing shows up if I use your method and it’s probably due to my fundamental misunderstanding of theming buddypress.

    https://buddypress.org/support/topic/buddypress-php-what-needs-to-be-in-it/


    @hastig
    While it is genuinely appreciated that you are trying to help people, some of what you are describing as template files is a little confused and will mislead people into thinking they have to use the advanced taxonomy template hierarchy which isn’t necessarily the case.

    I’d urge you check our codex pages again to best understand how overloading files works.

    The stackoverflow page would be better removed or at least edited to better reflect how the BP template hierarchy works.
    http://wordpress.stackexchange.com/questions/214774/is-there-a-list-of-what-buddypress-template-files-go-where-and-what-theyre-to-b


    Hastig
    Participant

    @hastig

    @hnla Hi Hugo, thanks for your feedback.

    I’ve updated the Stack Exchange question to better reflect what I’m looking to do. I also updated the answer with a second link to the Buddypress codex for those looking to do less specific Buddypress theming. Additionally, I added a disclaimer saying it is not the recommended method. Without any specific mistakes pointed out that’s about the best I can do for now.

    As for removing it, I’m sure it will be put on hold soon enough, seems they don’t like Buddypress (third party plugin) questions over there.

    Until then the answer solves my question and I can see it being useful for people looking to heavily customize things, I myself have been referring to it constantly. I would have been ecstatic to have found something like it 3 weeks ago when I began working on a buddypress theme.

    Of course, my being a noob means that answer will not be perfect. I will however keep it updated as I learn more and if there’s someone willing to better answer it I’m sure I wouldn’t be the only appreciative one.

    Apologies for hijacking this thread, wasn’t sure where better to reply.


    heytricia
    Participant

    @tendigit

    I’m in the process of integrating buddypress with a custom theme. First rodeo of this type…

    How often are the bp-lecacy files updated? I’d like to just merge them into my theme files, change templates as needed, and not load a bunch of extra css and js files. But I’d hate to miss critical updates by overriding all template, style and js files with my theme.

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