Shortcode not rendering, displayed as text

Hello
I have added a shortcode to a page but it is not displaying correctly:
http://699.25a.myftpupload.com/membership-options-page/

Other shortcode do work, like the pro-forms shortcode, here:

Other shortcodes on the site, not related to s2Member do work.
Would you know why this is happening?

Thanks,
Dan

That looks like you have a conflict with another plugin or (less likely) your theme. I’d suspect a caching or so-called security plugin.

Thanks Tim, but other s2Member shortcodes do work, so what would you say can cause this?

I saw that, Dan, but that just suggests that the conflicting code is running either only on the pages where you have the errant shortcode or that the conflicting code is conflicting because it is trying to do something that relates to the errant shortcode.

As I said, I’d be looking at caching and so-called security plugins, but you could start by deactivating all other plugins and clearing all caches to see if the problem disappears.

Thanks Tim,
I’ll try your suggestions.

Dan

So I added another shortcode in that page:
[s2Get user_field=“first_name” /]

That shortcode is displaying correctly, showing the user’s first name. So it’s probably an issue with the other shortcodes:

[s2If !current_user_can(access_s2member_level0)]
Hello, this area is for member only content.
[/s2If]



[s2If current_user_is(s2member_level0)]
Thank for registering to the Iaas Members Area.
Your membership is pending approval.
Once it's approved you will receive an email and will have access to our membership content.
Thank you and have a great day!
[/s2If]

What could be the problem with these conditional shortcodes?
Thanks,
Dan

Did you check for conflicts?

1 Like

Hi Tim
What conflicts should I look for?
The registration form (pro form) shortcode is working.
The s2Get shortcodes are working, just the conditionals aren’t.
s2memeber and the pro plugin are both latest versions.

Thanks
Dan

I changed the shortcode to this:
[s2If !is_user_logged_in()]Hello, this area is for members only content.[/s2If]
[s2If is_user_logged_in()]
Hello [s2Get user_field=“first_name” /],[/s2If]
[s2If current_user_is(s2member_level0)]Thank for registering to the Iaas Members Area.
Your membership is pending approval.
Once it’s approved you will receive an email and will have access to our membership content.
Thank you and have a great day![/s2If]

and now it’s working.
The change was replacing the first conditional with this:
[s2If !is_user_logged_in()]

Why is this happening?

Ah, I think I’ve twigged. It’s expecting subscriber instead of s2member_level0 and access_s2member_level0