Skip to content

Instantly share code, notes, and snippets.

Created November 2, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/60e19168365a9ba06be409ced6947180 to your computer and use it in GitHub Desktop.
Save anonymous/60e19168365a9ba06be409ced6947180 to your computer and use it in GitHub Desktop.
Single Training Page
<?php get_header(); ?>
<? if (has_post_thumbnail() ): ?>
<div id="featured-image">
<figure>
<? echo the_post_thumbnail('large'); ?>
</figure>
<? css_info(); ?>
</div>
<? else : endif; ?>
<div id="page" class="site">
<div id="primary" class="site-content row">
<main id="main" class="site-main small-12 medium-7 large-8 columns" role="main">
<? while (have_posts()) : the_post(); ?>
<article id="post-<? the_ID(); ?>" <? post_class(); ?>>
<? if (has_post_thumbnail() ): else : ?>
<header class="entry-header">
<? css_info(); ?>
</header>
<? endif; ?>
<div class="entry-content">
<? the_field('training_content'); ?>
</div>
</article>
<? endwhile; ?>
</main>
<aside id="right-sidebar" class="small-12 medium-5 large-4 columns" role="complementary">
<? if( have_rows('pdf_repeater') ): ?>
<h3 class="divider">Download Resources</h3>
<? while ( have_rows('pdf_repeater') ) : the_row(); ?>
<div class="pdf-container">
<a target="_blank" title="download <? the_sub_field('pdf_title'); ?>" href="<? the_sub_field('pdf_link'); ?>">
<div class="pdf-image" style="background-image:url('<? the_sub_field('pdf_image'); ?>');"></div>
<i class="fa fa-file-pdf-o" aria-hidden="true"></i> <? the_sub_field('pdf_title'); ?>
<div class="pdf-overlay">
<p>Download</p>
<p><strong>Training PDF</strong></p>
</div>
</a>
</div>
<? endwhile; ?>
<? else : endif; ?>
<? if( get_field('registration_type') == 'No' ): ?>
<? dynamic_sidebar('training_sidebar_without_registration'); ?>
<? elseif( get_field('registration_type') == 'Yes' ): ?>
<? dynamic_sidebar('training_sidebar_with_registration'); ?>
<? endif; ?>
</aside>
<? if( have_rows('registration_details') ): ?>
<hr id="registration-dates" />
<div class="small-12 medium-12 large-12 columns">
<h3 class="training-header-title divider">Course Registration</h3>
<h4><? the_field('registration_introduction'); ?></h4>
<h5 class="course-registration"><? the_field('registration_instructions'); ?></h5>
<? while ( have_rows('registration_details') ) : the_row(); ?>
<div class="registration-container">
<div class="event-training-table">
<h4><strong>Date:</strong> <? the_sub_field('registration_date'); ?></h4>
<p><strong>Location:</strong> <a href="<? the_sub_field('registration_address_link'); ?>"><? the_sub_field('registration_address'); ?></a></p>
</div>
<? $sub_id = get_sub_field('event_registration_id'); ?>
<? echo do_shortcode("[ESPRESSO_TICKET_SELECTOR event_id='".$sub_id."']"); ?>
</div>
<? endwhile; ?>
</div>
<? else : endif; ?>
</div>
</div>
<? get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment