BuddyBoss Home – Web Support Forums General Requests and Feedback Activity Wall – Show Featured image like Facebook

Viewing 14 posts - 1 through 14 (of 14 total)
  • Question

    #25039

    Hi there,

    I was wondering if Buddyboss could show featured images on the Activity wall. Just like the news feed on Facebook. No matter where the posts come from – Multisite compatible.

    At this stage it only shows images on the post/topic/update when added directly on the news wall. But I would like to see featured images from every post/topic/update network wide.

    Is this possible?

    Cheers,
    Ronald

    Answers

    #25192

    Alyssa
    Participant
    @alyssa-buddyboss

    I have added this to our request list

    #25225

    Awesome TJ,

    That’s is going to be a huge selling point as well for your guys as well as a huge improvement for community based sites. Specially now everybody is used to the FB wall news/info feed.

    Looking forward to it!

    Cheers,
    Ronald

    #28021
    @angslycke

    +1

    Have this in my current theme and it looks really nice. Shouldn’t be too complicated to implement, right? Maybe I can check the template code from my current theme and start from there.

    #30637

    Hi there again.

    Now that we are at the stage of having Buddyboss theme and Wall as a separate plugin does that mean that the BuddyBoss Wall plugin wil have this option?

    When network activated it can show featured/thumbnail images form posts/updates across the network (subsites).

    Cheers,
    Ron

    #32052

    Just a quick update:
    I found this link with some useful information. I tried adding the code to my functions.php and it’s almost working. Just not getting the img source.

    https://buddypress.org/support/topic/add-post-featured-image-in-activity-stream/

    Hope this helps!
    This is the snippet btw:

    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');
    #32886
    @milena

    Hi @rotju,

    I tried adding this code to my child theme functions php, and I get a weird combo of featured image, underneath it – the post’s embedded image and what is the most interesting is that the featured image is added to every comment one makes on that activity. (see attached image. p.s. site is rtl)

    Did you have a similar experience, and how did you fix it, if yes..?
    I am thinking there is some kind of code excess, but I haven’t figured out what need to go.

    Thanks

    #32922
    @milena

    ok, problem partially solved with the help of TJ.

    adding this to custom.css
    .activity-list .activity-content img.thumbnail {display:none;}
    leaves only the featured images on the activity feed.

    cool.

    but the feature image still displays in all of the comments on the post activity. (photo attached)

    What do you think that is?
    @tjchester, @angslycke, @rotju

    One clue I have is that these comments show up on the post itself. The opposite doesn’t, I am guessing this is another buddypress feature that is kind of half baked.

    Anyway- maybe it has something to do with the fact that the featured image shows up in the comments too. How does it look on your sites?

    #32996

    @Milena, I’m glad I got you on the way with the code snippet. But unfortunately I haven’t been able to get it to work yet. Even with the custom css code you gave from TJ, its still not working right.

    I’m getting broken images instead of featured images.

    #33010
    @milena

    Hi @rotju, I did this first –

    https://www.buddyboss.com/support-forums/topic/plugin-conflict-featured-image

    Since featured images are not naturally embedded within the posts in Buddyboss. Ypu need to add code to make them display, and then the activity will catch them.
    why don’t you try that and come back to me, it’s easier to figure this out together.

    #33059
    @milena

    Hi @rotju,

    I figured it out.

    last step, add this code to custom.css

    #buddypress div.activity-comments div.acomment-content img {
    display: none;
    }

    so just to recap the steps:
    1. add the function to display the featured image inside the post to content.php

    <?php if ( has_post_thumbnail() ) : ?>
    				<a class="entry-post-thumbnail" href="<?php the_permalink(); ?>">
    					<?php the_post_thumbnail('full'); ?>
    				</a>
    			<?php endif; ?>

    right after this part
    </div><!– .entry-meta –>`

    2. add your code to functions.php-

    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');

    3. add this css to custom.css

    .activity-list .activity-content img.thumbnail {display:none;}

    #buddypress div.activity-comments div.acomment-content img {
    display: none;
    }

    4. hope for the best.
    🙂

    let me know if that works out for you.

    #33060
    @milena

    @tjchester

    As you can see in my last comment I made the featured image work on activity page.

    But the code @rotju found in the buddypress forum ends with this part:
    add_action('bp_activity_excerpt_append_text', 'icondeposit_bp_activity_entry_meta');

    which makes all the excerpt look like this […] and be unclickable – no link. If you are writing a longer update – it cannot be expanded any more.

    I want exactly the opposite- that all the posts on activity will have a “read more” link.

    You gave me this code in another thread

    function cc_custom_excerpt_length() {
    return '358';}
    add_filter( 'bp_activity_excerpt_length', 'cc_custom_excerpt_length' );
    

    But the last bit from the featured image code cancels it out.

    How can we combine the two?

    see images attached. (first image is after the featured image code, second – how it was before)

    #33110
    @milena

    Hi @tjchester,

    Maybe you know a solution for this?

    Apparently it a known buddypress issue, and I haven’t been able to find a solution:
    It’s this part:`
    }
    add_action(‘bp_activity_excerpt_append_text’, ‘icondeposit_bp_activity_entry_meta’);`

    1. https://buddypress.org/support/topic/activity-stream-read-moreview-link-missing/
    2. https://buddypress.org/support/topic/read-more-in-activity-stream-not-there/
    3. https://bbpress.org/forums/topic/read-more-option-for-forum-updates-that-appear-in-the-activity-stream/

    A guy from buddypress said this

    @peeld We moved the permalink to the timestamp; click it.

    Is it possible to move the code back to “read more”
    (More info in my previous comment)

    #33111
    @milena

    Hey I found this :

    tjchester

    Member
    @tjchester 2 years, 11 months ago
    @boonebgorges Hello, I am working with a user on our theme forum with this same issue. I have replicated it, my support user informs me that this started to happen when he update Java, as in Sun Java…not sure how this relates to javascript if it does but may be a way for you to replicate this issue. What I am finding is that the read more link does not populate itself so it just stays as […]

    I am not sure what exchanges the […] with Read More but I think that is what is broken. I would be happy to help you to replicate this issue. Let me know what I can do to help you troubleshoot this issue.
    Thanks!

    Here https://buddypress.org/support/topic/desperate-for-help-with-activity-streamsread-more-link-fixes/

    Did you find out a solution?

Viewing 14 posts - 1 through 14 (of 14 total)
  • The question ‘Activity Wall – Show Featured image like Facebook’ is closed to new replies.