0

I'm using Buddypress 1.8.1

When the group home page load I want to show only 'activity_update' and 'joined_group' activities in Activity Loop.

Here is my Activity Loop code. It is standard loop code.

<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
    <?php while ( bp_activities() ) : bp_the_activity(); ?>

        <?php locate_template( array( 'activity/entry.php' ), true, false ); ?>

    <?php endwhile; ?>
<?php endif; ?>

How to filter these activities in page load. Thanks.

closed as off-topic by fuxia Jul 31 '14 at 19:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

0

I have created this function in bp-custom.php page.

function filtering_activity_default( $query ) {
  if ( empty( $query ) && empty( $_POST ) ) {
    $query = 'action=activity_update,joined_group';
  }
  return $query;
}

add_filter( 'bp_ajax_querystring', 'filtering_activity_default', 999 );

This is working for me as expected.

Not the answer you're looking for? Browse other questions tagged or ask your own question.