Skip Navigation

[Resuelto] A conditional statement is impacting style

This support ticket is created hace 7 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Daniella hace 7 años, 2 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#562981

I would like to style a categories that are not in the Custom Post Type of "Alerts" differently.

Link to a page where the issue can be seen: enlace oculto

The first title is an Alert. The next two are Posts.

I am using the following Content Template:
[wpv-conditional if="( '[wpv-post-type]' eq 'alert' )" evaluate="true"]<div class="alert"><h2 class="entry-title">[wpv-post-link]</h2><br /><span class="entry-meta">Filed under: [wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"]</span></div>[/wpv-conditional]

<div class="notalert">[wpv-conditional if="( '[wpv-post-type]' eq 'alert' )" evaluate="false"]
<h2 class="entry-title">[wpv-post-link]</h2><br />
<div class="one-third first">[wpv-post-featured-image size="custom" width="250" height="150"]</div><div class="two-thirds">[wpv-post-excerpt]<span class="entry-meta">Filed under: [wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"]</span></div>[/wpv-conditional]</div>

When I try to style the 'notalert' class, only the h2 becomes styled or the two Posts are styled together and not as separate entities. Not sure of the best way to accomplish this.

Thanks!

#563019

Dear Daniella,

I think you will need to wrap the entire HTML DIV tag <div class="notalert">...</div> into the [wpv-conditional] shortcode, for example:

[wpv-conditional if="( '[wpv-post-type]' eq 'alert' )" evaluate="true"]
<div class="alert">
<h2 class="entry-title">[wpv-post-link]</h2><br />
<span class="entry-meta">Filed under: [wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"]</span>
</div>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'alert' )" evaluate="false"]
<div class="notalert">
<h2 class="entry-title">[wpv-post-link]</h2><br />
<div class="one-third first">[wpv-post-featured-image size="custom" width="250" height="150"]</div>
<div class="two-thirds">[wpv-post-excerpt]<span class="entry-meta">Filed under: [wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"]</span></div>
</div>
[/wpv-conditional]
#563200

I've tried that as well and it still doesn't work. The 'notalert' class is only affecting the <h2>. Thanks for your help. Any other ideas?

#563218

It is a CSS problem, you can try below CSS codes:

div.notalert {
    background-color: blue;
    float: left;
}
#563298

Thanks!