Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1006019

    Is there a way to show the ajax search-tool in the enfold-mainmenu ONLY if a user is logged in?

    saludos
    yochen

    • This topic was modified 6 years, 3 months ago by jobalzer.
    #1006028

    Hey jobalzer,

    Please try to add this code to the child theme functions.php:

    
    add_action('init', 'avia_remove_search_for_logged_out_users', 10); 
    function avia_remove_search_for_logged_out_users()
    {
    	if(! is_user_logged_in())
    	{
    		remove_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 9997, 2 );
    		remove_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 9997, 2 );
    	}
    }
    

    Best regards,
    Dude

    #1006062

    quick and working response- tx a lot, dude!

    #1006105

    Hi,
    Glad Dude was able to help, unless there is anything else we can help with on this issue, shall we close this then?

    Best regards,
    Mike

    #1006127

    yes, problem solved, tx!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘activate search tool only for logged in users’ is closed to new replies.