I am trying to:
Display a Featured Video heading and associated video if the post reference field for product-featured-video is not empty. This used to work but, apparently, stopped working at some point, possibly as long ago as the update from the old style relationship to the newer style.
Right below the Featured Project View is a Visual Editor cell containing this:
<div style="text-align:center;max-width:720px;margin-bottom:20px;margin-top:15px;margin-left:auto;margin-right:auto;">
[wpv-conditional if="('1' eq '1')" debug="true"]
<h2>Featured Video</h2>
<div class="youtube-player" data-id="[types field='videoid' item='@product-featured-video.parent'][/types]"></div>
[/wpv-conditional]
</div>
The product-featured-video field is a post reference field and is populated.
Link to a page where the issue can be seen:
hidden link
Debug is on so you can see what is happening.
I expected to see:
An h2 title of "Featured Video" and the video.
Instead, I got:
Nothing.
Debug shows:
####################
wpv-conditional attributes
####################
Array
(
[if] => ( $(wpcf-product-featured-video) ne '' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( $(wpcf-product-featured-video) ne '' )
--------------------
--------------------
Converted expression: ( '' ne '' )
--------------------
Hi, you should be able to replace the $(wpcf-product-featured-video) syntax with the corresponding Types field shortcode in the conditional. Here's an update:
[wpv-conditional if="( '[types field="product-featured-video"][/types]' ne '' )"]
Product featured video is not empty
[/wpv-conditional]
That's assuming the slug is product-featured-video. If not, please adjust the slug as needed. Let me know if the problem is not completely resolved.
I am nearly positive I tried that alternative and it didn't work. But I just tried it again and it worked fine. Maybe it was a caching issue last time. Regardless, it is working now. Thanks!