Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Editing Buddypress core files within the childtheme


  • singhnavjeet
    Participant

    @singhnavjeet

    Hello Buddypress,

    I am using “Buddy: Multi-purpose WordPress & BuddyPress Theme” the theme has a child theme and i am able to style the site without any problem. My concern is I would like to edit some buddypress plugin file like “bp-core-widgets.php” and “register.php” I have did some edit and after updating the plugin to Version 2.1.1 I have lost all my changes, which is natural.

    My question is like woocommerce you can create a woocommerce within the child theme and edit the file and worry about the changes getting lost in the update, how do i achieve this with buddypress ??

    Your help is highly appreciated.

    Regards,
    Singh

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

  • shpitzyl
    Participant

    @shpitzyl

    Within your child theme, you can only use budypress template files – the files inside /bp-template/bp-legacy/.

    In order to edit the template files you have to create a folder named buddypress inside your child theme folder. Every file you want to edit should be inside the same directory structure as in bp-legacy.

    For example:
    If you want to edit activity-loop.php then you place the file in:
    your-child-theme/buddypress/activity/

    Editing css and js:
    your-child-theme/css/buddypress.css
    your-child-theme/js/buddypress.js

    Another thing that you should look at are hooks. Buddypress has many hooks that you can use inside your functions.php. I’ve never found any structured documentation about it. but you can learn a lot about it from tutorials online. Here is a blog with many tutorials
    http://bp-tricks.com/

    Sometimes you can’t find hooks to everything you want to do so what I do is documenting my hacks in the core so I can keep track of them when it is time to upgrade.


    singhnavjeet
    Participant

    @singhnavjeet

    Thank you very much Shpitzyl for your reply,

    I wanted to edit “bp-core-widgets” the directory is plugins >buddypress > bp-core > bp-core-widgets.php , so within my child theme I have created a folder “buddypress” and within that folder a subfolder “bp-core” and bp-core-widgets.php is the same directory as the plugin. But when i edit the file in child theme directory my edit does not show whereas if i edit the file within the plugin directory it works. Please help me where have i gone wrong 🙁 do I have to specifically all any thing in my child theme style.css ??


    /*
    Theme Name: Buddy Child Theme
    Description: Child Theme
    Version: 1.0
    Author:
    Author URI:
    Template: buddy
    Tags: buddypress
    */

    @import url("../buddy/style.css");

    Thank you very much Shpitzyl


    shpitzyl
    Participant

    @shpitzyl

    No, you didn’t understand what I was saying. Read again the first line on my post. You can use in your child theme only the template files inside bp-template. You can’t use the core files.

    widget.php is not a template file. If you want to edit widget.php you have only two option.
    1. Try to find a hook inside the file.
    2. If you can’t find a hook then you can only hack the core.


    singhnavjeet
    Participant

    @singhnavjeet

    Oh, Thank you very much Shiptzyl, will check again really appreciate your help 🙂


    jessicana
    Participant

    @jessicana

    This is really useful! So let’s make this based on ftp url’s to confirm our understanding. If (buddypress.js) path is:
    /MYDOMAINNAME.com/html/wp-content/plugins/buddypress/bp-templates/bp-legacy/js
    and I want to edit this in my child theme, I have to create js folder inside my child theme. The path will be:
    /MYDOMAINNAME.com/html/wp-content/themes/ChildThemeName/js
    Inside the js folder in the child theme directory I will copy and past buddypress.js there and edit it at my convenience. The updates will not affect this file, do I ever have to worry about updating this?

    Regarding buddypress CSS, do I have to create a folder for Buddress like this one: your-child-theme/css/buddypress.css to style buddypress? or I can add this to the style.css in the child theme directory? what is the best practice?

    If I want to make updates to buddypress CSS for desktops and get rid of those updates (styles) on the ipad and phones to keep on responsiveness. What do you suggest I do?

    Thanks


    1a-spielwiese
    Participant

    @1a-spielwiese

    If (buddypress.js) path is:

    /MYDOMAINNAME.com/html/wp-content/plugins/buddypress/bp-templates/bp-legacy/js

    and I want to edit this in my child theme, I have to create js folder inside my child theme. The path will be:

    /MYDOMAINNAME.com/html/wp-content/themes/ChildThemeName/js

    But in reality the path is:

    wp-content/plugins/buddypress/bp-templates/bp-legacy/BUDDYPRESS/js/buddypress.js

    Therefore the path for the copy must be:

    wp-content/themes/ChildThemeName/BUDDYPRESS/js/buddypress.js


    jessicana
    Participant

    @jessicana

    @1a-spielwiese
    Inside bp-legacy we have three folders and one file:
    The folders are:
    1) buddypress
    2) css
    3) js
    The file is buddypress-functions.php.

    Buddypress folder contains (activity, blogs, forums, groups, members).

    The path you specified doesn’t exist in my directory listing. When I follow your link I get (Failed to retrieve directory listing).

    Thanks


    1a-spielwiese
    Participant

    @1a-spielwiese

    The folders are:
    1) buddypress
    2) css
    3) js
    The file is buddypress-functions.php.

    Sorry, you are right. The folders css and js are on same level as buddypress; not below. My mistake.


    shpitzyl
    Participant

    @shpitzyl

    @jessicana

    If I want to make updates to buddypress CSS for desktops and get rid of those updates (styles) on the ipad and phones to keep on responsiveness. What do you suggest I do?

    You can use media queries to make different styles to different screen sizes.


    jessicana
    Participant

    @jessicana

    Well, if I am customizing a theme using a child theme, do I have to use these media queries before each element I am changing or editing? Will one media query at the begging get this job done?


    danbp
    Participant

    @danbp

    @jessicana,

    Regarding buddypress CSS, do I have to create a folder for Buddress like this one: your-child-theme/css/buddypress.css to style buddypress? or I can add this to the style.css in the child theme directory? what is the best practice?

    Both are best practice. 😉
    But if you’re working with a child-theme, you add a folder named buddypress or community to the child and copy only the template you want to modify from bp-legacy into this folder, by respecting the same path form as in bp-legacy.

    CSS can be added directly to child style.css
    JS modification goes to /your_child/buddypress/js/your_js.js

    Theme Compatibility & Template Files


    singhnavjeet
    Participant

    @singhnavjeet

    Thank you very much shpitzyl I am able to edit “register.php” file within my child theme like you said.

    Regards,
    Singh


    OsamaNuman
    Participant

    @osamanuman

    Thanks for the tip!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Resolved] Editing Buddypress core files within the childtheme’ is closed to new replies.
Skip to toolbar