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: hidden link
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!
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]
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?
It is a CSS problem, you can try below CSS codes:
div.notalert {
background-color: blue;
float: left;
}