Skip to:

Adding custom user specific content to profile body

  • a608237


    I am tinkering with some tricks shown here:

    It has been mostly successful and straight forward more or less. The examples in the link adds customized content to the user’s HEADER section however (where Avatar & last-active time is shown) using:

    add_action( ‘bp_profile_header_meta’, ‘my_function’ );

    How might I add actions to the main body of a profile page (i.e. in the Base profile section [before and after])? I’ve tried substituting ‘bp_profile_header_meta’ with the other hooks shown in the tutorial i.e.:

    add_action( ‘bp_before_profile_content’, ‘my_function’ );
    add_action( ‘bp_before_member_activity_content’, ‘my_function’ );

    but none of them displays the content within the main body of the profile. Please help.
    Thanks in advance.

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

  • Venutius


    You could try bp_before_profile_field_content and bp_after_profile_field_content



    Thanks Venutius,

    I am slightly closer to what I want to achieve. There is something slightly odd about the way it appears on the front end using those hooks: before each ‘block’ of fields (i.e. Base, Profile, extended) it seems my_function is called once, but it is not in a loop of any sort.

    Is there a way to get it to call my_function say.. before the Base Fields?



    Oh you want to display something actually in the field loop, here’s the hook for that – bp_profile_field_item

    That’s all the hooks on that page. If you want to do something different to that then you would probably need to overload the profile-loop.php template file. it’s in plugins/buddypress/bp-templates/your-bp-theme/members/single/profile/profile-loop.php. You’d edit a copy of that then put it in themes/your-child-theme/buddypress/members/single/profile

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