How to add descriptive text to top of buddypress pages

Our site is sports related. I've changed "groups" to "teams" and have added a few public groups. I would like to add descriptive information to top of the page that explains Teams purpose just above the Directory Heading. I've added text to the top of the page but it does not display. What do I need to do to have this text info display?

  • 3SixtyEvolve

    Hi antKat

    Greetings from my support desk!

    Can you expand a bit more on your requirement, please? From your post I understand that you would like to add text below the 'logo' area, correct?

    Where exactly did you add the text? On a template file as part of the code or on an actual page?

    Appreciate if you can provide me with a bit more details, just to ensure that I give you the correct information.

    Look forward to hear from you.

    GinaB

  • aecnu

    Greetings antKat,

    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU Dev member!

    Cheers, Joe

  • Patrick

    Hi antKat,

    There are a couple of ways you can do this, but each requires a file edit.

    1. In your theme/child-theme's functions.php file, add the following code just below the opening <?php tag, and change the message to whatever suits your site. Note that this code hooks into an action which will display your message just below the directory heading as in the attached screenshot.

    function my_bp_groups_message (){
     echo 'This is a custom message to show on the groups directory.';
    }
    add_action('bp_before_directory_groups_content', 'my_bp_groups_message');

    2. If you want the message above the heading (as you stated in your original post), open your theme's groups/index.php file and paste the following just below <div class="padder">:
    <?php _e( 'This is a custom message to show on the groups directory.', 'buddypress' ) ?>
    The drawback with method #2 is that when you update Buddypress, your message will disappear and you'll need to add that text back in. With method #1, as long as you're using a child-theme (and I hope you are), you're update-safe.

    Hope this helps! :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.