Question

I have the following code:

{is_future}
<tr>
    <td>#_EVENTLINK</td>
    <td>#d/#m/#Y</td>
    <td>#_EVENTNOOFDAYS</td>
    <td>#_EVENTTIMES</td>
    <td>{not_free}#_EVENTPRICEMAX{/not_free} {fully_booked}Geen plaatsen beschikbaar{/fully_booked}</td>
</tr>
{/is_future}

The problem is that it breaks the {not_free} tag (removing that causes it to break {fully_booked} instead), causing it to read as "{not_free}$3.50" instead of the actual price. It seems to me that I'm not allowed to put conditional tags within other conditional tags.

Does anyone know a solution for this? Thanks in advance.

Edit: I am using the Wordpress Eventmanager plugin.

Was it helpful?

Solution

See Events Manager documentation for Conditional Placeholders, section “Nesting Conditional Placeholders” on the very bottom:

It is possible to use conditional placeholders within each other. However, by default Events Manager will only go one level deep, meaning it won’t check conditional placeholders within conditional placeholders. This is due to the extra processing required to acheive such behaviour.

In order to enable further levels of nesting, you need to add a line of PHP to your wp-config.php file:

define('EM_CONDITIONAL_RECURSIONS',2);

The example above will go 2 levels down, meaning you could nest conditional placeholders within another conditional placeholder. If you wanted to nest one inside the nested placeholder, then you need to increase that number to 3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top