mardi 25 juillet 2017

Trying to write a PHP if/else statement but failing miserably can anyone help me out?

So I'm trying to make a if/else statement in PHP, I have the if statement down and it's returning what I want, but I can't seem to figure out the else statement. Does anyone have any ideas?

<div class="row">
        <?php while($items->have_posts())   : $items->the_post(); ?>

                    <?php 

                    if( get_field('sauce_or_spice') ): ?>
                    <div class="large-4 medium-6 columns">
                        <h5><?php the_title(); ?></h5>
                    <a href="http://ift.tt/2uvHjeb" ?>
                        <div class="thumbnail products">
                            <?php the_post_thumbnail('thumbnail'); ?>
                        </div>
                    </a>
                        <p><?php the_field('description'); ?></p>
                        <p><?php the_field('price'); ?></p>
                        <a class="video-button">Buy now!</a>
                    </div>
                 <?php elseif( get_field(!('sauce_or_spice')) ): ?>
                 <?php echo'HELLO'; ?>
                <?php endif; ?>
        <?php endwhile;?>
    </div>

Aucun commentaire:

Enregistrer un commentaire