Home>Support>Showing different content (button) for logged-in users

Showing different content (button) for logged-in users

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

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.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 5 months ago Alex S
    Hi, I Work Here

    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.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More