Passer la navigation

[Résolu] change class conditional

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 4 années et 8 mois. 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 -

Fuseau horaire du supporter : Asia/Hong_Kong (GMT+08:00)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par pierre-yvesC Il y a 4 années et 8 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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("lien caché"); 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>lien caché</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!