Skip to:
Content
Pages
Categories
Search
Top
Bottom

I don’t understand the template files

  • @jblevins1991

    Participant

    I am trying to start using buddypress. I am currently a wordpress developer, but the documentation gives little to no api information for starters. It tells me the php files and the order of importance, but I have no idea what any of these files actually do. It doesn’t say buddypress.php’s purpose is this or this file will be used for this. Can someone help me out with this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • @jblevins1991

    Participant

    So I found this page, which says I can make a directory named buddypress or community. However, it doesn’t say the name of any of the files I can override. What files can I override and what do they do?

    @jblevins1991

    Participant

    I found the answer myself. BuddyPress uses specific folders for the default pages (Activity, Groups, Forums, etc.) located at wp-content/plugins/bp-templates/bp-legacy/buddypress. In each folder found here are the corresponding default templates. These can be added to a folder you create in your theme. The folder you add to your theme must be named community or buddypress.

    @jblevins1991

    Participant

    I guess I didn’t have the answer. Can someone seriously help me out? There are no notes on this anywhere on google and I don’t see it on the site or on github. I’m about to give up on buddypress.

    @lovemonk

    Participant

    I believe any files you want to edit from within your theme must follow the complete folder structure as viewed within the Buddypress plugin. Not just lumped into a single Buddypress folder.

    @jblevins1991

    Participant

    I just figured that out. I have the activity folder added to the twentyfifteen theme. I am trying to modify the file, but it really doesn’t look like it should. I am logged in and I dont see any activity nor do i see the message Sorry, there was no activity found, Please try a different folder.

    I am so confused and frustrated. I am pretty competent with wordpress as well as php, and i don’t feel like this should be so difficult.

    @hnla

    Participant

    @jblevins1991 You need to explain exactly what you have attempted so that we may understand where things are going wrong, so you need to show exact steps and directories and files created / copied over.

    Assuming you have setup WP and BP correctly and have a vanilla instance of BP running under a theme of your choice then:

    You create a dir or folder in your themes root e.g /buddypress/ if you want to modify the main activity screen then create /buddypress/activity/ and copy index.php from the plugins bp-legacy dir to this new directory, add some text somewhere in that file so you can see if BP is using that file rather than the version located in bp-legacy.

    In our guide the salient issue of what templates and where is covered in this paragraph:

    Therefore, you can modify any bp theme compatibility template by copying it over from:

    /bp-templates/bp-legacy/buddypress/

    To:

    /my-theme/community/ or /my-theme/buddypress/

    N.B. Inside the subfolder ‘community’ you must preserve the path structure/folders that exist in the BP original /buddypress/ folder so /activity/ must be created to hold index.php or any of the other activity templates.

    If you are using a WP theme or theme that is subject to updates you must create a child theme of that theme and do all work in that, this avoids you losing any changes in a theme – guides for creating WP child themes are available on the WP codex.

    @jblevins1991

    Participant

    Creating a child theme is not necessary. I figured out that if you create template files using the //Template Name you can go to the pages that BuddyPress makes and assign template pages to those pages. So you can create a file named activity.php and make it a template file and add the activity loop inside of that file. Once you have assigned that template to the Activity page in the WordPress dashboard you can then go to the BuddyPress settings and make sure that your Activity page is set up under the Activity drop down and save changes and it will work. I didn’t want to add unnecesary steps to making a single theme that did everything I needed. I will work on compiling a tutorial series on how to work with BuddyPress and then contribute it to the codex. Thank you for the response. Also if you look at the code in the BuddyPress plugin on the codebase you will see that bp-legacy is completely deprecated. There is compatibility code to not break old themes, but it is not the best way to do things.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I don’t understand the template files’ is closed to new replies.
Skip to toolbar