BuddyDev

Search

[Resolved] BP Group Description

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #25825

    Hi Brajesh,
    I’m using bp-nouveau and I have activated the Group Homepage and the option to…
    “Display the group description in the body of the group’s front page.”

    That description is sometimes long and that way I’m using this code to get an excerpt in group header…

    
    function bp_excerpt_group_description( $description ) {
    
    $length = 170;
    $description = substr($description,0,$length);
    return $description;
    }
    
    add_filter( 'bp_get_group_description', 'bp_excerpt_group_description');
     

    …but I would like to see all the text in the body of the group’s front page and not an excerpt.

    Would you please change the code the way that I get the excerpt in the group header and full text in the body.

    Thanks, Hans

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #25826

    …would be nice to have an excerpt ending with “…”!

    PS: and with the code I mentioned I got some warning in my error log…

    Warning: explode() expects parameter 2 to be string, array given in /home/www-data/<domain>/wp-content/plugins/buddypress/bp-templates/bp-nouveau/includes/functions.php on line 724
    Ignore

    Warning: array_map(): Expected parameter 2 to be an array, null given in /home/www-data/<domain>/wp-content/plugins/buddypress/bp-templates/bp-nouveau/includes/functions.php on line 725

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #25831

    Hi Hans,
    I will look into it and assist you tomorrow.

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #25841

    Hi Brajesh,
    Do you have a minute today to assist me?

    Thanks, Hans

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #25851

    Hi Hans,
    Sorry but I am not able to provide any snippet.

    BP Nouveau does not provide any consistent action hook between the header and the content.
    If there were any, we could have used did_action() to easily accomplish it.

    My suggestion will be to override default-fron.php and put this line at top.

    
    remove_filter( 'bp_get_group_description', 'bp_excerpt_group_description');
     
    

    That way, you remove the above filter from being applied to front page content.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #25858

    Hi Brajesh,

    That’s working perfect. Thank you!

    Regards,
    Hans

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #25872

    Thank you. I am glad it is working 🙂

    Regards
    Brajesh

The topic ‘ [Resolved] BP Group Description’ is closed to new replies.

This topic is: resolved