Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of zudie
    zudie
    Participant

    @zudie

    Use this code in either your functions.php or bp_custom.php:

    `add_filter( ‘bp_blogs_activity_new_post_content’, ‘my_activity_content’, 2, 10 );
    function my_activity_content($activity_content, $post, $post_permalink){
    $postid=$post->ID;
    $activity_content = get_the_post_thumbnail( $postid );
    $activity_content .= bp_create_excerpt( $post->post_content, 25 );
    return $activity_content;
    }`

    This creates the content block of your activity stream. In the example it adds the thumbnail for the featured image and it creates an excerpt.

    Profile photo of zudie
    zudie
    Participant

    @zudie

    If you want to manipulate the output of the button, use: bp_follow_get_add_follow_button
    Then use the necessary php to split up the string and modify.

    `global $bp;
    $my_follow_button=bp_follow_get_add_follow_button( array(‘leader_id’=>$post->post_author,’follower_id’=>$bp->loggedin_user->id));`

    Profile photo of zudie
    zudie
    Participant

    @zudie

    I think I got the right direction for you:

    In bp-custom.php add:

    `/Change wording in Activity Stream and use post_type iso of ‘post’
    add_filter( ‘bp_blogs_activity_new_post_action’, ‘im_activity_content’, 2, 10 );

    function im_activity_content($activity_content, $post, $post_permalink){

    $activity_content = sprintf( __( ‘%s submitted a new ‘.$post->post_type.': %s’, ‘buddypress’ ), bp_core_get_userlink( (int)$post->post_author ), ‘‘ . $post->post_title . ‘‘ );
    $activity_content .= bp_create_excerpt( $post->post_content, 25 );

    return $activity_content;
    }`

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar