Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp-custom.php in folder?


  • Carsten Lund
    Participant

    @carsten-lund

    The bp-custom.php resides in the /wp-content/plugins/ folder according to this thread:

    bp-custom.php

    When I move the code snippets from functions.php the codes have no effect.

    I expect the bp-custom.php needs to be placed in an folder, if yes, what should this be named?

    Regards
    Carsten

    Regards

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

  • Henry Wright
    Moderator

    @henrywright

    The file path should be wp-content/plugins/bp-custom.php. If that doesn’t work for you then there’s likely a problem elsewhere.


    Carsten Lund
    Participant

    @carsten-lund

    I am looking at the thread “Adding profile fields to members directory”
    https://buddypress.org/support/topic/adding-profile-fields-to-members-directory/

    You wrote:

    There’s 2 ways of doing this.

    1. You could modify the members-loop template (see the BuddyPress Template Hierarchy for details on how that’s done). See here. You would just add bp_member_profile_data( ‘field=the field name here’ ); to the template.

    2. Add this to your theme’s functions.php file:

    function add_info_to_members_loop() {
    echo bp_get_member_profile_data( ‘field=the field name here’ );
    }
    add_action( ‘bp_directory_members_item’, ‘add_info_to_members_loop’ );

    Which template are you referring to in 1.?
    can both code snippets be placed either in functions.php or bp-custom.php?


    Henry Wright
    Moderator

    @henrywright

    Which template are you referring to in 1.?

    Check out the Template Hierarchy article. The file you’d need to copy and then modify is buddypress/members/members-loop.php.

    can both code snippets be placed either in functions.php or bp-custom.php?

    2 can but 1 isn’t a code snippet (you’re copying and then modifying a file).


    Carsten Lund
    Participant

    @carsten-lund

    Thanks, I have read the page about Template Hierarchy, can see this is very complex, at least to me.

    I looked to the buddypress directory which looks different:

    wp-content > plugins < buddypress > bp-members > ?

    members_loop.php does not exist, is this aam I in the wrong directory?

    I have tried to ad a buddypress.php file to both my theme and child theme directory, but this will prevent my site from loading?


    Henry Wright
    Moderator

    @henrywright

    You can find all of the templates in a buddypress folder here: bp-templates/bp-legacy.

    Step 1. Copy the buddypress folder to your theme. You should then have something that looks like this: wp-content/themes/your-theme/buddypress
    Step 2. Edit the files inside the buddypress folder.


    Carsten Lund
    Participant

    @carsten-lund

    Copy, and at the same time leave the original buddypress folder under plugins?


    Henry Wright
    Moderator

    @henrywright

    You shouldn’t modify the original plugin files.


    Carsten Lund
    Participant

    @carsten-lund

    I mean, the buddypress folder in bp-templates/bp-legacy


    Carsten Lund
    Participant

    @carsten-lund

    Thanks, now I think I understand…


    Carsten Lund
    Participant

    @carsten-lund

    copying the buddypress folder containing the members-loop.php to my child theme leaves my page blank.
    And now the folder can’t be deleted from the child theme…

    “buddypress” could not be deleted, because an error (22126) occurred.


    Carsten Lund
    Participant

    @carsten-lund

    Hmmm, probably an browser error


    Henry Wright
    Moderator

    @henrywright

    How are you trying to delete the buddypress folder?


    Carsten Lund
    Participant

    @carsten-lund

    First I tried Textwrangler, it diden’t work, then I managed to delete the folder with FileZilla

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