Title: Combining Conditional Placeholders
Last modified: August 21, 2016

---

# Combining Conditional Placeholders

 *  Resolved [benlwong](https://wordpress.org/support/users/benlwong/)
 * (@benlwong)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/)
 * First of all, thanks for such a great plugin. The documentation is fantastic.
 * I am trying to combine conditional placeholders following the instructions on
   the doc page: [http://wp-events-plugin.com/documentation/conditional-placeholders/](http://wp-events-plugin.com/documentation/conditional-placeholders/).
 * I added the line on the bottom of wp-config.php – the file that’s in the root
   of the WordPress installation directory. However, it doesn’t seem to work.
 * The snippet of code I am trying to get to work:
 *     ```
       {is_future}
       {has_att_event_register_link}
       <p>
          <a class="register-button" href="#_ATT{EVENT_REGISTER_LINK}">Register</a>
       </p>
       {/has_att_event_register_link}
       {/is_future}
       ```
   
 * Note that I have tested the code with one or the other conditional placeholder
   and it works fine. It only fails when I have both in. I also have code for the
   custom conditional placeholder.
 * [http://wordpress.org/plugins/events-manager/](http://wordpress.org/plugins/events-manager/)

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

 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978069)
 * Hi,
 * You need to put the code in a template file. Which page do you want to display
   the code on?
 *  Thread Starter [benlwong](https://wordpress.org/support/users/benlwong/)
 * (@benlwong)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978075)
 * Not sure what you meant. The above snippet of code is in Events -> Settings -
   > Formatting -> Events -> Single Event Page.
 * Again, it works well if there is only one conditional placeholder. It doesn’t
   seem to work if there are two.
 * The other code mentioned in the Events Manager documentation said it should be
   in wp-config.php. Are there multiple wp-config.php? The doc doesn’t mention which
   one (if there are multiple ones).
 * Thanks,
    Ben
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978093)
 * Hi Ben,
 * Sorry, I got confused – I thought you meant you’d put everything in wp-config.
   php.
 * There’s only one wp-config.php file, so that’s not the problem.
 * Where does the _{has\_att\_event\_register\_link}_ placeholder come from? Is 
   that the custom placeholder you’ve added yourself? If it is, does it work ok 
   on its own?
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978160)
 * you need to add something to your wp-config file to enable nesting, see the docs
   link in your OP and look at the bottom section of that page
 *  Thread Starter [benlwong](https://wordpress.org/support/users/benlwong/)
 * (@benlwong)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978176)
 * Marcus,
 * Unless I am mistaken (and maybe I wasn’t being clear), the something you mentioned
   I have already added, as indicated in my first post.
 * To be more specific, I have already added the following line to wp-config (unless
   you are talking about something else):
 * `define('EM_CONDITIONAL_RECURSIONS',2);`
 * Ben
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978177)
 * What’s the _{has\_att\_event\_register\_link}_ placeholder? Is that a custom 
   placeholder you’ve created? If it is, does it work ok when not nested?
 *  Thread Starter [benlwong](https://wordpress.org/support/users/benlwong/)
 * (@benlwong)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978194)
 * Yes, the has_att_event_register_link is a custom placeholder I created, and yes,
   I have tested it by itself and it works. To summarize:
 * When only using {has_att_event_register_link} custom placeholder – works
 * When only using {is_future} placeholder – works
 * When using both {has_att_event_register_link} and {is_future} placeholders – 
   DON’T work
 * When using both {has_location} and {is_future} placeholders – DON’T work – just
   to make sure it isn’t my custom placeholder
 * BTW, I add the following line at the bottom of the wp.config.php file. I am assuming
   that should be okay?
 * `define('EM_CONDITIONAL_RECURSIONS',2);`
 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978204)
 * yes, that should work – `define('EM_CONDITIONAL_RECURSIONS',2);` at the end of
   your wp-config.php
 * however, I tried this one and seems to be working fine; can you try to disable
   your custom functions to see if things will work now?
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978213)
 * how about removing your customizations altogether? i.e. at a code level.
 * recursions work for me, just tested
 *  Thread Starter [benlwong](https://wordpress.org/support/users/benlwong/)
 * (@benlwong)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978231)
 * I removed the customizations (code for the custom conditional placeholders) and
   still not working. I tested it with:
 * {has_location}
    {is_future} <p> [Register](https://wordpress.org/support/topic/combining-conditional-placeholders/?output_format=md#_ATT{EVENT_REGISTER_LINK})
   </p> {/is_future} {/has_location}
 * Other thoughts?
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978245)
 * maybe try putting it in one line, or different spacing?
 * I copy/pasted the above and it works for me.

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

The topic ‘Combining Conditional Placeholders’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [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

 * [combination](https://wordpress.org/support/topic-tag/combination/)
 * [conditional placeholder](https://wordpress.org/support/topic-tag/conditional-placeholder/)
 * [event-manager](https://wordpress.org/support/topic-tag/event-manager/)
 * [multiple](https://wordpress.org/support/topic-tag/multiple/)

 * 11 replies
 * 4 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/combining-conditional-placeholders/#post-3978245)
 * Status: resolved