Search Box and "more" Tab


#1

I need help with two things:

  1. How do i remove/disable the “more” tab on user or group profile pages. I don’t need it.
  2. How do i hide the search field from logged out users just like the “friends”, notifications:, and " “messages” icons are hidden from logged out users?

#2

Hello @bhekzinto,

1 ) You can hide more tab and make all tabs visible by adding below Custom Javascript code from Custom codes tab under Inspirebook admin settings:

jQuery(window).on('load',function(){
    var a = jQuery('.rtp-more-menus ul').html();  
    jQuery('.rtp-more-menus').parent().append(a);  
    jQuery('.rtp-more-menus').remove();    
});

And below css code to Custom Css section :

.rtp-more-menus { display:none;}

2 ) I would like to clarify your requirement :

  • Do you want to display Login as well as Search options to just logged in users?

Thank you.


#3

Thanks. The more tab issue is resolved.I managed to hide the login button on my front so that’s also reloved. I want to display the search field only to logged on users. I dont want logged out users seraching the site.


#4

Hello Bheki,

You can add following code in your child themes functions.php

/**
* Header Search Form for loggedin users only
*/
function rtp_child_header_search_form() {
    if ( is_user_logged_in() ) {
        get_search_form();
    }
}

add_action( 'rtp_hook_within_header', 'rtp_child_header_search_form' );

Thanks


#5

I added the above code to the child theme’s functions.php but the search box is still vissible to logged out users


#6