-
Author
-
December 15, 2015 at 17:42 #93402
corpor8chic
ParticipantHello 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?
December 15, 2015 at 17:57 #93409sharmstr
ModeratorIs 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 16, 2015 at 01:27 #93526corpor8chic
ParticipantThat 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?
December 16, 2015 at 01:41 #93527sharmstr
ModeratorGotcha. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 16, 2015 at 05:27 #93556corpor8chic
ParticipantAh 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!
December 16, 2015 at 15:35 #93630sharmstr
ModeratorIt 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 CODEadd_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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 16, 2015 at 17:55 #93658corpor8chic
ParticipantWow 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!
December 16, 2015 at 18:20 #93666sharmstr
ModeratorIt 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.