Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Adding custom posts to activity- and changing the name of the activity action

@milenushka

Participant

Wow, @shanebp, thank you so much! That worked perfectly!

Perhaps you can help me with something else, i’ve been struggling for some time?

I would like to add the featured image to these activity updates (whether it’s a regular blog post or the custom post – such as projects).

I found this code before- this one is for posts. It works, but there is something in it that makes all the excerpts in the activity – short and unclickable.
Also some custom post types do not show the attached image.

function icondeposit_bp_activity_entry_meta() {
 
    if ( bp_get_activity_object_name() == 'blogs' && bp_get_activity_type() == 'new_blog_post' ) {?>
        <?php
        global $wpdb, $post, $bp;
        $theimg = wp_get_attachment_image_src(  get_post_thumbnail_id( bp_get_activity_secondary_item_id() ) );
        ?>
        <img src="<?php echo $theimg[0]; ?>" >
 
    <?php }
 
}
add_action('bp_activity_excerpt_append_text', 'icondeposit_bp_activity_entry_meta');

And another thing I was researching and could find any reference to :
How can I add the group description to the activity update?
I think if it shows up in the activity- it should at least carry some information that will make members want to click and join the group.

Thank you for your help!

Skip to toolbar