<?php
    $query = new WP_Query([
        'post_type' => 'prototypes',
        'posts_per_page' => -1,
    ]);
    // Get the other posts exect first element
    $prototypes = $query->posts;
    // print_r($prototypes);
    ?>

 <?php  if ( $prototypes ) : ?>
        <?php foreach ( $prototypes as $key => $post ): ?>
            <?php $number = $key; if ($number % 2 == 0): ?>
                <div class="wyn-strip-component wyn-component">
                    <div class="row">
                        <div class="col-2 strip-image">
                            <picture>
                                <img
                                    srcset="<?php if ( has_post_thumbnail($post->ID ) ) {the_post_thumbnail_url($post->ID); }?>, <?php if ( has_post_thumbnail($post->ID ) ) {the_post_thumbnail_url($post->ID); }?> 2x"
                                    title="<?= $post->post_title ?>"
                                />
                            </picture>
                        </div>
                        <div class="col-2 strip-content">
                            <div class="strip-content-container wyn-wysiwyg">
                                <h3 class="strip-heading"><?= get_field('alternative_title', $post->ID) ?></h3>
                                <div class="body wyn-wysiwyg">
                                <p><?= get_field('short_description', $post->ID) ?></p>
                                </div>
                                <a class="button outline clear primary" href="<?= esc_url( get_permalink($post->ID) )?>">
                                    <span class="icon-view"></span><?php echo __( 'Find Out More', 'felicityhealth' );?>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            <?php else: ?>  
                <div class="wyn-strip-component wyn-component">
                    <div class="row inverted">
                        <div class="col-2 strip-image">
                            <picture>
                                <img
                                    srcset="<?php if ( has_post_thumbnail($post->ID ) ) {the_post_thumbnail_url($post->ID); }?>,
                                    <?php if ( has_post_thumbnail($post->ID ) ) {the_post_thumbnail_url($post->ID); }?> 2x
                                    "
                                    title="<?= $post->post_title ?>"
                                />
                            </picture>
                        </div>
                        <div class="col-2 strip-content">
                            <div class="strip-content-container wyn-wysiwyg">
                                <h3 class="strip-heading"><?= get_field('alternative_title', $post->ID) ?></h3>
                                <div class="body wyn-wysiwyg">
                                <p><?= get_field('short_description', $post->ID) ?></p>
                                </div>
                                <a class="button outline clear primary" href="<?= esc_url( get_permalink($post->ID) )?>"><span class="icon-view"></span><?php echo __( 'Find Out More', 'felicityhealth' );?></a>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endif ?>  
        <?php endforeach; ?>
 <?php endif; ?> 
