Hi,
How do I display alternative text when the custom field is empty in a shortcode?
For example, I want to use the text "No date has been set" when the event date is empty?
[wpv-conditional if="( empty($(wpcf-event-date)) )"]
No date has been set[/wpv-conditional]
DATE: [types field="event-date"][/types] | ADRESS: [types field="event-location"][/types]
[wpv-conditional if="( empty($(wpcf-event-date)) )"]
DATE: No date has been set
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-event-date) ne '')"]
DATE: [types field="event-date"][/types]
[/wpv-conditional]
| ADRESS: [types field="event-location"][/types]
One condition is for empty and one condition is for not empty.
Can you please share problem URL where the date is setup and not setup and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The topic ‘[Closed] how to use if empty condition within the HTML shortcode ?’ is closed to new replies.