• Resolved amineriad

    (@amineriad)


    Hello, I have added a custom field ( concat name) in the description space of a single event. this field is optional. How can I hide in the word “contact name” if it is not filled by the organizer. Which means that contact – should appear next the name if is filled but if it is left empty, the word ” Contact” should disappear.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Rita Kikani

    (@kikanirita)

    Hi @amineriad ,

    to put validation like if field value is blank then need to hide that on single event page, then you need to override template file called : content-single-event_listing.php

    To override template file, you need to copy the file from “wp-content\plugins\wp-event-manager\templates\content-single-event_listing.php” and need to paste it on your theme side “wp-content\themes\YOUR_THEME\wp-event-manager\content-single-event_listing.php” and then you need to put condition to hide empty field in your file which you pasted at your theme side.

    You need to add condition on line no. : 164 like from ?if (isset($field_value)) : to ?if (isset($field_value) && !empty($field_value)) : in your theme side file.

    For more info about how to override template file, you can see : https://wp-eventmanager.com/knowledge-base/template-files-override/

    Thank you.

    Thread Starter amineriad

    (@amineriad)

    Fixed. thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Contact if empty’ is closed to new replies.