Hello. I have a property listings website that has been working well for years. However, I just noticed something by chance.
I have a relationship between listings and agents. On a single listing post, when an agent is not assigned to the listing, the agent name for the listing displays the property address (which is the post title). How can I display, "No agent assigned" instead?
Here's the code I am using on the single listing view. Any help appreciated. 🙂 Eric
If there is no connected post and the shortcode returns null, you can just check if it is an empty string, it is functionally equivalent with the wpv-conditional shortcode.
Check this legacy documentation about how to insert a conditional shortcode for fields from a related post: