Skip Navigation

[Resolved] change class conditional

This thread is resolved. Here is a description of the problem and solution.

Problem:

Use [wpv-conditional] shortcode to setup background image.

Solution:

Please try to wrap the background image URL with single quote and test again, for example:

https://toolset.com/forums/topic/change-class-conditional/#post-1826849

Relevant Documentation:

This support ticket is created 4 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by pierre-yvesC 4 years ago.

Assisted by: Luo Yang.

Author
Posts
#1826223

Hi,

I'm trying to use what is explained here https://toolset.com/forums/topic/change-css-of-sidebar-tabs-based-on-value-of-view/ without good results.

So I tried to style it in line instead of using classes. It works pretty well except for adding background image :

<div style="height: 100%;
[wpv-conditional if="( '[wpv-post-id]' eq '2796' )"]background-color: #bd1b21; [/wpv-conditional]
[wpv-conditional if="( '[wpv-post-id]' eq '2801' )"]background-color: #529546; [/wpv-conditional]
[wpv-conditional if="( '[wpv-post-id]' eq '2803' )"] background-image: url("hidden link"); background-repeat: repeat; background-color: #a70e13; color: #ffffff;[/wpv-conditional]">
content
</div>

The background image just doesn't show up
Any idea?

Many thx

#1826849

Hello,

Please try to wrap the background image URL with single quote and test again, for example:

<div style="height: 100%;
[wpv-conditional if="( '[wpv-post-id]' eq '2796' )"]background-color: #bd1b21; [/wpv-conditional]
[wpv-conditional if="( '[wpv-post-id]' eq '2801' )"]background-color: #529546; [/wpv-conditional]
[wpv-conditional if="( '[wpv-post-id]' eq '2803' )"] background-image: url('<em><u>hidden link</u></em>'); background-repeat: repeat; background-color: #a70e13; color: #ffffff;[/wpv-conditional]">
content
</div>

It works fine in my localhost,

#1827029

Ah yeah! Single quote vs double quote. It always mystify me.

You're the boss, my issue is resolved. Many thx!