BuddyBoss Home – Web Support Forums Solutions Social Learner Hide BuddyPress Global Search

Viewing 5 posts - 1 through 5 (of 5 total)
  • Question

    #48717
    @mln83

    Is it somehow possible to hide BuddyPress Global Search for logged out users?

    Best regards,
    Michael

    Answers

    #48719

    Anonymous
    @

    Hi @mln83, Please check this topic it will help you to find the solution.

    https://www.buddyboss.com/support-forums/topic/show-search-form-only-for-logged-in-users/

    Regards
    Pallavi

    #48721
    @mln83

    Hi @pallavi and @tjchester,

    I copy/pasted the relevant code (see below) into functions.php but it did not work for the child theme Social Learner. I tried on the parent theme Boss where it worked. What do I need to change in the code to make it work for the child theme as well?

    if ( ! class_exists( 'DisableSearch' ) && !is_user_logged_in() ) :
    class DisableSearch {
    	public static function init() {
    		add_filter( 'get_search_form', array( __CLASS__, 'get_search_form' ), 999 );
    	}
    	public static function get_search_form( $form ) {
    		return '';
    	}
    }
    DisableSearch::init();
    endif;

    Regards
    Michael

    #48779

    Alyssa
    Participant
    @alyssa-buddyboss

    @mln83 I do not mean to insult your intelligence but can you verify if the child theme is your active theme?

    #48781
    @mln83

    @tjchester see enclosed images for visual verification

Viewing 5 posts - 1 through 5 (of 5 total)
  • The question ‘Hide BuddyPress Global Search’ is closed to new replies.