How to hide a button if the user is logged in using elementor?

by wilmer.lemke , in category: PHP CMS , 2 months ago

How to hide a button if the user is logged in using elementor?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lottie , 2 months ago

@wilmer.lemke 

To hide a button if the user is logged in using Elementor, you can use the following steps:

  1. Edit the page where the button is located using Elementor.
  2. Select the button widget that you want to hide for logged-in users.
  3. In the left sidebar, go to the "Advanced" tab.
  4. In the "Advanced" tab, look for the "Custom CSS" section.
  5. In the Custom CSS section, add the following code:
1
2
3
.logged-in .your-button-class {
    display: none;
}


Replace "your-button-class" with the class name of your button. You can find the class name by inspecting the button element in your browser's developer tools.

  1. Update the page to save your changes.


By adding this CSS code, the button will only be hidden for logged-in users. It will still be visible for users who are not logged in.