Quantcast
Viewing all articles
Browse latest Browse all 20145

Conditional Statement for displaying Custom Fields in Views

I have a Custom Field called Reviews that show up on Client CPTs. I have them set to display in other locations on the site such as the Home page and Services page as social proof. However I cannot find the right conditional statement to display them properly.
I only want something to display if the Review field has been filled out. And if there isn't an entry to not use it.

[wpv-if testimonial="[types field="reviews" class="" style=""][/types]" evaluate="!empty($testimonial)"]
[types field="reviews" class="white-text"][/types]
<span class="client-name">-[wpv-post-title]</span>
[wpv-if]

Website is here for reference:
http://test.kelleewalsh.com/

There is a Testimonial lower right on the main page. At times you'll see a blank testimonial. It will show the name of the client however. But if the testimonial field is empty, it should skip it and use one that's full.

Thanks for your help.


Viewing all articles
Browse latest Browse all 20145

Trending Articles