Title: Using Conditional Logic on a Template
Last modified: December 7, 2023

---

# Using Conditional Logic on a Template

 *  Resolved [Ben Rothman](https://wordpress.org/support/users/brothman01/)
 * (@brothman01)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/using-conditional-logic-on-a-template/)
 * How do I put a link to the ticket URL on the template ONLY IF there is a ticket
   URL specified? I feel like I saw this somewhere but I cannot find the syntax 
   and I do not see it in the documentation.

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

 *  Plugin Author [Joe Dolson](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/using-conditional-logic-on-a-template/#post-17266472)
 * Something like `{event_tickets before="<a href='" after="'>Buy Tickets</a>"}`
   should work.
 * This will be easier soon; I’m introducing PHP templating in the next major release.
   But it’ll be a couple of months, yet.
 *  Thread Starter [Ben Rothman](https://wordpress.org/support/users/brothman01/)
 * (@brothman01)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/using-conditional-logic-on-a-template/#post-17268401)
 * that is awesome, I am excited. Yes the “{” instead of “[” made the Buy Tickets
   link conditional based on whether or not it was declared, thanks!

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

The topic ‘Using Conditional Logic on a Template’ is closed to new replies.

 * ![](https://ps.w.org/my-calendar/assets/icon-256x256.png?rev=1097576)
 * [My Calendar - Accessible Event Manager](https://wordpress.org/plugins/my-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/my-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-calendar/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ben Rothman](https://wordpress.org/support/users/brothman01/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/using-conditional-logic-on-a-template/#post-17268401)
 * Status: resolved