Title: Conditional custom attributes
Last modified: January 13, 2024

---

# Conditional custom attributes

 *  Resolved [onojane](https://wordpress.org/support/users/onojane/)
 * (@onojane)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/conditional-custom-attributes-2/)
 * I want to add a new section or div to the single event page template with a title
   for the section and two custom attributes with labels. The entire section would
   be conditional based on whether the event has a presentation or not. I can figure
   out the html mostly except I don’t know how to make the section conditional. 
   So like this:
 * PRESENTATION
 * Title: #_ATT{Presentation Title}
 * Speaker(s): #_ATT{Speakers}
 * There are not really any examples of how to add even non-conditional custom attributes
   to the templates. How can I do this? Seems like EM should have a conditional 
   placeholder for any custom attributes you want to add to the templates, but I
   have not found one.
    -  This topic was modified 2 years, 5 months ago by [onojane](https://wordpress.org/support/users/onojane/).
    -  This topic was modified 2 years, 5 months ago by [onojane](https://wordpress.org/support/users/onojane/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/conditional-custom-attributes-2/#post-17341534)
 * Here you can find an example of how to add a conditional placeholder for a custom
   attribute: [https://wordpress.org/support/topic/conditional-placeholders-for-custom-event-attributes/](https://wordpress.org/support/topic/conditional-placeholders-for-custom-event-attributes/)
 *  Thread Starter [onojane](https://wordpress.org/support/users/onojane/)
 * (@onojane)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/conditional-custom-attributes-2/#post-17345324)
 * I did see that post and tried the snippet. However I could not get it to work
   and I think it would only control whether the custom attributes were displayed
   and not what I want which is the entire section with a header and labels. However
   I thought of another way that should work for me to make this section conditional.
   I can insert my section surrounded by conditional tag or category placeholders
   in the single event page format box in settings. That seems to work well. Here
   is an example:
 *     ```wp-block-code
       {has_category_meetings}
       <div>
       	<h3>Presentation</h3>
       	<p><strong>Title:</strong> #_ATT{Presentation Title}<br>
       	<strong>Speaker(s):</strong> #_ATT{Speakers}</p>
       </div>
       {/has_category_meetings}
       ```
   
    -  This reply was modified 2 years, 4 months ago by [onojane](https://wordpress.org/support/users/onojane/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional custom attributes’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [custom attributes](https://wordpress.org/support/topic-tag/custom-attributes/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * 2 replies
 * 2 participants
 * Last reply from: [onojane](https://wordpress.org/support/users/onojane/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/conditional-custom-attributes-2/#post-17345324)
 * Status: resolved