I am trying to:
display things based upon role.
Link to a page where the issue can be seen: hidden link
If I have a conditional static value = static value and both sides are 1, then it displays. If I try to use role or post data then nothing display. If I put two conditional on one page, one of them being the static example and the other using user or post data, then nothing prints at all, not even the static values that are true.
I expected to see: the block, which says STATIC VALUE = 1
Instead, I got: nothing
Hi,
Thank you for contacting us and I'd be happy to assist.
To troubleshoot this, I'll need to see exactly how this page is set up in the admin area.
Can you please share temporary admin login details, in reply to this message? Make sure that the page includes at least one conditional block that is not working as expected.
Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.
regards,
Waqar
While I was creating a page to demonstrate the problem, I realized that what I am really trying to do is determine if someone is logged in. Once they have logged in, they no longer need to see some particular buttons. So, I then tried to set up a conditional logic for determining if the visitor is logged in or not. And, I can not find any option in the conditional dropdown to express whether a user is logged in or not. So, that is what I need. I need to have a conditional block that determines whether or not a user is logged in.
I further tried to use the shortcode
[wpv-current-user info="logged-in"] = STATIC VALUE true
And it did not work. I tried using values 0 and 1 for false and true and that didn't work. Even though the documentation says it returns true or false.
The output of [wpv-current-user info="logged-in"] displays the username. So, I tried comparing the shortcode to a STATIC VALUE of nothing... just no value listed in the conditional dialog. And, that didn't work. Quite frustrating.
Thank you for sharing these details.
To show some content, only to guests (i.e. non-logged-in) visitors, you can use an empty check for the current user's ID.
( example screenshot attached )
For guests, the value of the 'current user ID' will be empty and so the contents of the conditional block will show. For the logged-in users, the 'current user ID' will not be empty and so the same content won't be visible to them.