Hi, I would like to display different buttons depending on whether the user is logged-in or not. If the user is logged-in, he/she will see the “Start Survey” button, otherwise, he/she will see the “Register” button.
I have downloaded the plugin that allows me to insert PHP code inside the SiteOrigin widget (button, for example), but it does not seem to work.
My conditional logic looks like this:
if ( is_user_logged_in() ) {
display: none;
} else {
display: block !important;
}
I would like to know whether it is possible to apply this PHP code to the element using its id and class in some editor.
Thank you in advance for your response.
Hi Polina,
Unfortunately, this isn’t possible without a fair amount of custom coding. This is beyond the scope of what we can help you with on our forums, but you could hire a developer to implement this for you.
With that said, logged in users will have a body class added called logged-in that can you use to target this area.
We recommend using Codeable. You’ll be able to hire someone at an hourly rate to do this work for you.