-2

I am using buddypress on my site and i want to hide "All Groups" tab and show only "My Groups" tab to the loggedin user.

Anand
  • 3
  • 1
  • 5

2 Answers2

0

remove "All Groups" Tab in to the loggedin user

Add below function in function.php file

if ( is_user_logged_in() )
{
    function hide_all_groups_tab() {
    ?>
    <script type="text/javascript">
     jQuery( document ).ready( function( $ ) {
         jQuery("#groups-all").removeClass('selected');
         jQuery('.item-list-tabs ul li:first').css('display', 'none');
         jQuery("#groups-personal").addClass('selected');
    } );
    </script>

    <?php
    }
    add_action( 'wp_footer', 'hide_all_groups_tab' );
}
Shital Marakana
  • 2,817
  • 1
  • 9
  • 12
-1

I had to change .item-list-tabs to .groups-nav-tabs but it works like a charm.