ben-g
6/21/2017 - 8:51 PM

Basic php custom post file

Basic php custom post file

<?php get_header(); ?>


			<div id="content">

               <div class="interior-banner" style="background-image: url(<?php the_field( "banner_image" ); ?>); ?>">
                    <h1 class="page-title" itemprop="headline"><?php the_title(); ?></h1>
               </div>

                <div class="presentations">
                    <h2>Main Title</h2>
                    <div class="wrap">

                        <?php

                        // check if the repeater field has rows of data
                        if( have_rows('presentation') ):

                                // loop through the rows of data
                            while ( have_rows('presentation') ) : the_row(); ?>

                                <div class="presentation">
                                    <p class="presentation__track"><?php the_sub_field('track'); ?></p>
                                    <div class="wrap">
                                        <a href="<?php the_sub_field('presentation_link'); ?>" target="_blank">
                                        <h4><?php the_sub_field('presentation_title'); ?></h4>
                                        <?php
                                        if( have_rows('speaker') ):

                                                // loop through the rows of data
                                            while ( have_rows('speaker') ) : the_row(); ?>

                                                <p><?php the_sub_field('speaker_name'); ?></p>

                                        <?php endwhile; endif; ?>
                                        <span>View Presentation</span>

                                        </a>
                                    </div>
                                </div>

                        <?php  endwhile;  endif; ?>
                    </div>
                </div>

			</div>

<?php get_footer(); ?>