mercredi 8 juillet 2015

Wordpress "If" statement on advanced custom fields

I am trying to echo an error message if no content has been uploaded to my custom post type repeater field.

Some pages will have content and others wont so I just want a simple message saying, sorry we currently have no stock for this artist please come back.

Here is my html:

<?php if( have_rows('artist_paintings') ): ?>

    <ul class="slides">

    <?php while( have_rows('artist_paintings') ): the_row(); 

        // vars
        $thumb_image = get_sub_field('thumbnail');
        ?>

        <li class="slide">
        <img src="<?php echo $thumb_image; ?>" />
        </li>

    <?php endwhile; ?>

    </ul>

<?php endif; ?>

Aucun commentaire:

Enregistrer un commentaire