Skip Navigation

[Resolved] Trying to use conditionals to format css button

This support ticket is created 6 years 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+00:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 6 years ago.

Assisted by: Nigel.

Author
Posts
#1188934

I am trying to: hide a button using divi if condition is met

Link to a page where the issue can be seen: hidden link

I expected to see: the class "hidden" to show

Instead, I got: nothing

#1189015

Nigel
Supporter

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

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

How are you trying to hide the button?

This is a Divi button module that you want to hide, based upon some test you are using wpv-conditional for, is that right?

(I can't see the link you shared to your localhost.)

#1189084
Capture.PNG

Hi Nigel,

I am trying to hide a button if there is no link using a wpv-conditional.

I am trying to do it through CSS see attached.

Let me know if there is any other way of doing it.

#1189608

Nigel
Supporter

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

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

Shortcodes are not parsed there, so that cannot work.

If your button has a specific ID then somewhere on the page where you can enter markup where shortcodes are parsed (e.g. in a text module), you could directly add style tags inside a conditional, so you had something like this wrapped inside your wpv-conditional shortcodes:

<style type="text/css">
#my-button {
  display: none;
}
</style>

So that markup will only get added to the page if your condition is met, and will hide the button if it is.