Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Hide element if WordPress user logged in Reply To: Hide element if WordPress user logged in

#286008
Dagny
Participant

What you can do is use a function to add a class in the body if user is logged in. For example:

https://pastebin.com/fSqv5g3p

And then target the buttons you want to disable like this.


.logged_in .button{
display:none;
}

check if WP doesn’t automatically add classes on the body (or in any other parent) when the user is logged in where you can use them.