This topic has 7 replies, 2 voices, and was last updated 8 years by sharmstr.

  • Author
  • #93402
     corpor8chic
    Participant

    Hello there,

    I am using the Kleo Activity Stream, I would like to remove or hide the excerpt from the stream..I tried CSS but it doesn’t seem to work at all …any Suggestions?

    #93409
     sharmstr
    Moderator

    Is this what you’re after?

    COPY CODE
    
    .kleo-activity-streams .activity-inner {
        display: none !important;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #93526
     corpor8chic
    Participant

    That didn’t quite work as expected…that removed the image too..perhaps is there someway to just shorten the excerpt? Perhaps I need to change the Buddypress file?

    #93527
     sharmstr
    Moderator

    Gotcha. But…. where is the image coming from. From an rtMedia upload with the activity update? From a featured image on a published post activity?

    If its from rtMedia upload via an update, you can try

    COPY CODE
    
    .kleo-activity-streams .rtmedia-activity-text {
        display: none !important;
    }
    

    If its from a published post, that would be more difficult since everything is contained within a p tag. There is no separation of text and image. Kleo only stylizes Buddypress output so, you’d have to ask the buddypress guys how to edit their published post activity function so that it doesnt save the text of the post, only the featured image, to the activity table. Or how to change it so it adds a tag around the text and a separate tag around the image so you can control the display of each via css.

    Hope that make sense.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #93556
     corpor8chic
    Participant

    Ah the images are from published post…and ask the Buddypress guys? That is a total joke..if it weren’t for themes like yours Buddypress would have died long ago.

    Well thanks a lot!

    #93630
     sharmstr
    Moderator

    It took me forever to figure this out, so I wont be tweaking it for you, but….

    Try this code if you want. It doesnt differentiate between the Kleo Activity Stream shortcode and the buddypress activity page. In other words, it will filter all instances of New Post activities. It looks for a featured image for the post. If it finds one, it only returns the featured image. If it doesnt find one, it displays the post excerpt as it normally would.

    COPY CODE
    
    add_filter( 'bp_get_activity_content_body', 'strip_post_excerpt' );
    function strip_post_excerpt( $array  ) {
        global $activities_template;
    
        if ( 'new_blog_post' == $activities_template->activity->type ) {
            $thumb = get_the_post_thumbnail( $activities_template->activity->secondary_item_id, 'full' );
            if ( $thumb ) {
                $array = $thumb;
            }
        }
        return $array;
    }
    

    I hope you find it useful.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #93658
     corpor8chic
    Participant

    Wow BRILLIANT..I will definitely try this I had all but given up!

    So I am thinking I add this to my Child theme and then add the CSS code?

    Thanks again!

    #93666
     sharmstr
    Moderator

    It goes in your functions.php file. No css needed.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Plugins questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?