mardi 1 décembre 2015

if/else with foreach and if statement inside - Parse error: syntax error, unexpected '}'

I keep getting syntax errors on this piece of code, any help would be greatly appreciated, thanks.

<?php 

$day = get_field_object('day_of_the_week');
$value = $day['value'];
$choices = $day['choices'];

    if( $value ): ?>
        <ul>
            <?php foreach( $value as $v ): ?>
                <li>
                    <?php if( $v != $page_title ) { ?>
                        <a class="btn" href="/venture-centre/activities-2/<?php echo $choices[ $v ]; ?>#<?php echo basename(get_permalink()); ?>">
                            <?php echo $choices[ $v ]; ?>
                        </a>
                        <?php } ?>
                </li>
                <?php endforeach; ?>
        </ul>

        <?php } else { ?>
                    <p>This activity is only available on <?php echo $page_title ?>.</p>
        <?php } ?>

        <?php endif; ?>

Aucun commentaire:

Enregistrer un commentaire