BuddyDev

Search

Just a Activity Feed with the latest Comments and Forum posts

  • Participant
    Chris on #4127

    I want just create a Activity Feed with the latest Comments, without picture and without Text.

    Just: Chris86 wrote a new post, TITEL OF THE POST 1 day, 5 hours ago

    is this possible with your tool? I need a big help 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #4131

    Hi Chris,
    Welcome to BuddyDev.

    You can do it easily by copying the activity loop. I recommend making a copy of activity loop and removing the undesired part.

    You can use that inside a page template if that helps.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4132

    Hi Chris,

    Welcome to the BuddyDev. Please paste the following code in your bp-custom.php and use shortcode [activity-custom-loop] in your page or post.

    
    
    function buddydev_activity_custom_loop() {
    
    	if( ! function_exists( 'buddypress' ) || ! bp_is_active( 'activity' ) ) {
    		return '';
    	}
    
    ?>
    
    	<?php if ( bp_has_activities( array( 'per_page' => false ) )  ) : ?>
    
    		<ul id="activity-stream" class="activity-list item-list">
    
    			<?php while ( bp_activities() ) : bp_the_activity(); ?>
    
    				<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
    
    					<div class="activity-content">
    
    						<div class="activity-header">
    
    							<?php bp_activity_action(); ?>
    
    						</div>
    
    					</div>
    
    				</li>
    
    			<?php endwhile; ?>
    
    		</ul>
    	<?php else : ?>
    
    		<div id="message" class="info">
    			<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
    		</div>
    
    	<?php endif; ?>
    
    	<?php
    }
    add_shortcode('activity-custom-loop','buddydev_activity_custom_loop');
    
    

    Let me know if it works for you or not.

    Thank You
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved