Skip Navigation

[Resolved] Shortcode visible on the front-end

This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 7 replies, has 2 voices.

Last updated by Bochnacki 7 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#463672
shortcode.jpg

I used a shortcode:

[wpv–conditional if="( '[wpv-current-user info="role"]' eq 'customer' )"]
[cred_user_form form='38' form_name='Edytuj konto']
[/wpv–conditional]

[wpv–conditional if="( '[wpv-current-user info="role"]' eq 'dealer' )"]
[cred_user_form form='113' form_name='Edytuj konto dealera']
[/wpv–conditional]

It works well, but it remains visible on the front-end. No matter if I write this in view, whether in the entry.
What could be causing this error?

#463869

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi

I tried to reproduce the problem on a couple of test sites but was unable to, so it appears to be something particular to your site.

The list of plugins you have installed seems to be mostly Toolset plugins and doesn't look problematic.

Could you please try switching your theme to twentysixteen and seeing if that narrows down the problem?

#463909

Unfortunately, after switching to twentysixteen it is the same error.

#464024

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Can you clarify how and where you are adding this code to your site?

For example, if you add it directly to a static page do you get the same result?

#464066

Indifferent where I'll put this code, the effect is the same. In static pages, and if inserting a View, and in custom template - everywhere is the same - shortcode is visible.
It may be something set up for the role of "dealer"? This role I created, but I did not do anything in the settings, in addition to setting accesses.

#464113

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I'm at a bit of a loss to account for what is happening, perhaps I should take a look myself if that is okay.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes other than possibly to temporarily add a backup plugin to take a snapshot of the site.

Can you also confirm the url of where I can see the problem.

#464472

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I'm having problems seeing anything with your theme.

When I visit posts on the front-end nothing is rendering.

I switched to twentysixteen for testing and then was unable to reproduce the problem.

Specifically, I created a new custom post type "Toolsets" and created a content template assigned to single Toolset posts, with the following content:

[wpv-conditional if="('[wpv-current-user info="role"]' eq 'administrator')"]
<p>You are an administrator</p>
[/wpv-conditional]

[wpv-post-body view_template='None']

I then created a sample Toolset post and visited it on the front end, and it rendered entirely as expected, including the message "You are an administrator".

When switching back to your theme nothing renders in the content area, but, as I say, that is the same for your standard posts.

Can you tell me concretely where I can expect to see the problem?

#464520

Nigel thank you for your help, I was able to fix it.

I wondered why shortcode, which was visible at the front end is in the form: [wpv-conditional if = '(' customer 'eq' customer ') "]
Shortcode how I used it [wpv-conditional if = '(' [wpv-current-user info = "role"] 'eq' customer ') "] - it seems correct, but gave an error on the front end.

I tried this code:
[wpv-conditional if = '(' [wpv-current-user info = 'role'] 'eq' administrator ') OR ('[wpv-current-user info = 'role'] 'eq' customer ') "]
[Cred_user_form form = '38 'form_name =' Edit Account '] [/ wpv-conditional]

And now the error is not up and running as I wanted.
The strange thing, but it works 🙂

I am writing this because maybe someone will help.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.