Display Button only to logged in users.

Hey there,

I want to add a button that links to a form but it should only be displayed to users who are logged in.. there's no option for it in muffin builder & I also tried a custom CSS


.hiddenelement {

display:none;

}


.logged-in .hiddenelement {

display: block;

}

but even this is not working.. Please help on how to hide the button to users who are not logged in.. also mention where to enter the code as I am not a developer & have no idea as to where to place the code.

Comments

  • Hi,

    Please always attach a link to your website so we can check it out. If the page is offline(localhost), then our help will be limited. You will have to contact us when the page is online. Also, please make sure that the page is not under maintenance before you provide us with the link.

    Thanks

  • Hey Phil, I do understand that you need to see the webpage, but it's a live site & I can't keep that button on it if it's accessible to people before signing up. So I am attaching some screenshots.. of the page before logging in & after logging in.. I want that button to only to be showed to people who are logged in..

    Still if you want to have a look at the site you can visit: https://hrddesignawards.com

    & while you're at it also visit this page.. [Links visible only for registered users] I just can't make any kind of changes on it.. Muffin builder just doesn't work on this page.. just this page.


  • I have used the CSS you prepared on my website, and it is working correctly.

    As you can see the yellow button on the left is visible when I am logged in.

    Please send us WordPress dashboard access privately thru the contact form, which is on the right side at [Links visible only for registered users] and we will check what might be the reason.

    Notice!

    Please attach a link to this forum discussion.

    Thanks

  • Hey Phil,

    I sent the dashboard access via above provided form.. the button needs to be placed on this page:

    [Links visible only for registered users]

    & the link attached on the button should be: [Links visible only for registered users]

    Thanks for the help, kindly update when done..

  • I have added the button and CSS for it. Can you check that, please?

    You need to only adjust the button display and its text.


    Best regards

  • Thanks! that worked. Can I know what I was doing wrong? Because I also have to hide a page that is only accessible by selected users.

  • I have added the .hiddenelement class to the button, and your custom CSS in the Page Options.

    And that is it. I do not know all steps you did, so I cannot tell what exactly you did wrong.


    Best regards

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.