Navigation überspringen

[Gelöst] change class conditional

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 Jahre, 8 Monaten. 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 -

Zeitzone des Unterstützers: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von pierre-yvesC vor 4 Jahre, 8 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#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("versteckter 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>versteckter 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!