Issue accessing group admin area


I created some groups and now I would like to change the information for some of the groups/committees: I’m using the latest version of WP and BP with the bp-community theme from wpmudev.

I’m signed in as admin and when I click ‘admin’ on the page I want to change (or from the group management in the dashboard) I get the following error:
Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/o/r/cornhill/html/cornhillbeta/wp-content/themes/bp-community-child/functions.php:3) in /home/content/c/o/r/cornhill/html/cornhillbeta/wp-includes/pluggable.php on line 890

The problem started when I added the code from this page: Is there another way to change the mystery man that won’t affect accessing the admin area?

Also, is there a way to change the group avatars after they have been created?

Thank you.

  • Mason


    I've got a very similar setup and am not seeing these issues. Check your functions.php file in the child directory. Is everything typed correctly between opening and closing php tags? Many time this error is caused by extra white space before or after the php tags, so check that as well.

    Also, you'd like you can save the functions.php file as a txt and upload it here so we can take a look.

    A link would be helpful as well :smiley:

  • ellaj

    Hi masonjames,

    Here is the code:
    <?php add_theme_support( 'automatic-feed-links' ); ?>

    <?php function myavatar_add_default_avatar( $url )

    return get_stylesheet_directory_uri() .'/_inc/images/mystery-man.png';
    add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' ); ?>

    <?php function my_default_get_group_avatar($avatar) {

    global $bp, $groups_template;

    if( strpos($avatar,'group-avatars') ) {

    return $avatar;

    else {
    $custom_avatar = get_stylesheet_directory_uri() .'/_inc/images/mystery-man.png';

    if($bp->current_action == "")
    return '<img width="'.BP_AVATAR_THUMB_WIDTH.'" height="'.BP_AVATAR_THUMB_HEIGHT.'" src="'.$custom_avatar.'" class="avatar" alt="' . attribute_escape( $groups_template->group->name ) . '" />';
    return '<img width="'.BP_AVATAR_FULL_WIDTH.'" height="'.BP_AVATAR_FULL_HEIGHT.'" src="'.$custom_avatar.'" class="avatar" alt="' . attribute_escape( $groups_template->group->name ) . '" />';
    add_filter( 'bp_get_group_avatar', 'my_default_get_group_avatar'); ?>

    As I said, the code creates the default avatars for the members and groups, but when I'm signed in and I go to the admin section of a group I get an error.
    What am I doing wrong?

    Thank you!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.