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

    #48093

    Is it possible to disable search function for non-logged in users? Guest should not be able to browse content of a platform that he has no access to.

    Answers

    #48099

    I have already found the solution.

    I’ve put this into css

    #titlebar-search {
    display: none;
    }

    .logged-in #titlebar-search {
    display: block;
    float: right;
    }

    But I have noticed that on hompage slider (while changing slide) closes the search input area. It is most annoying. Can anything be done with this issue?

    #48197

    Anonymous
    @

    Hi @bcim
    You can remove following function

    
    <div id="header-search" class="search-form">
                            <?php
                            echo get_search_form();
                            ?>
                            </div><!--.search-form-->
    

    with

    
    <?php if ( is_user_logged_in() && buddyboss_is_bp_active() ) : ?>
                            <div id="header-search" class="search-form">
                            <?php
                            echo get_search_form();
                            ?>
                            </div><!--.search-form-->
    <?php endif; ?>
    

    inside the header.php line 64
    please copy header.php inside the child theme first and edit inside the child theme

    Regards
    Varun Dubey

    #48199

    My mistake. I thought that Social Learner is a Child theme for Boss but it seems to be a little different (SL header.php is different that Boss header.php). I use SL so please update your reply. Will this fix the bug od closing search input area by slider on homepage?

    #48202

    Anonymous
    @

    For social learner, you have to replace

    
     <!-- search form -->
    <!--                        <div id="header-search" class="search-form">-->
                            <div id="titlebar-search">
                            <?php
                            get_template_part( 'searchform', 'header' ); 
                            ?>
                            <a href="#" id="search-open" class="header-button" title="<?php _e( 'Search', 'social-learner' ); ?>"><i class="fa fa-search"></i></a>
                            </div><!--.search-form-->
    

    with

    
    <?php if ( is_user_logged_in() && buddyboss_is_bp_active() ) : ?>
     <!-- search form -->
    <!--                        <div id="header-search" class="search-form">-->
                            <div id="titlebar-search">
                            <?php
                            get_template_part( 'searchform', 'header' ); 
                            ?>
                            <a href="#" id="search-open" class="header-button" title="<?php _e( 'Search', 'social-learner' ); ?>"><i class="fa fa-search"></i></a>
                            </div><!--.search-form-->
    <?php endif; ?>
    

    Regards
    Varun Dubey

    #48203

    I works exact the same as my display: none solution though it is more Pro, but it does not solve the problem with slider bug.

    #48415

    Anonymous
    @

    Hi @bcim, Please attache the screenshot to get exact idea , it seems fine to me
    Regards

Viewing 7 posts - 1 through 7 (of 7 total)
  • The question ‘Search disable’ is closed to new replies.