• Resolved norbertk

    (@norbertk)


    I don’t see any menu options to disable the site form when a user is not logged in. Where in the plug-in (with my child theme) can I add is_user_logged_in to show the form?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    I hope you are well today and thank you for your question.

    You can achieve this for admin users by enabling the search form option as shown in this screenshot https://imgur.com/a/tr7yEyT

    For other users, you can develop custom code as below.

    if ( is_user_logged_in() ) {
    	echo do_shortcode( '[ivory-search id="1707"]' );
    }

    Please change the search form ID in the above code.

    Best regards,

    Thread Starter norbertk

    (@norbertk)

    The search is added as part of the main menu. How can I only load it for the main menu when a user is logged in?

    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    You can achieve this by adding the below CSS code in the Custom CSS option of Ivory Search plugin settings on the path Admin Area -> Ivory Search -> Settings -> Settings

    body:not(.logged-in) li.is-menu {
        display: none !important;
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disable search for logged out users’ is closed to new replies.