Skip to content

Instantly share code, notes, and snippets.

@kangabell
Created September 16, 2016 21:31
Show Gist options
  • Select an option

  • Save kangabell/4cbe98651365b042666d01598adc956f to your computer and use it in GitHub Desktop.

Select an option

Save kangabell/4cbe98651365b042666d01598adc956f to your computer and use it in GitHub Desktop.
About Page Template for launchsource.com
<?php
/*
Template Name: Our Team
*/
$background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' );
?>
<?php get_header(); ?>
<div id="main" class="row" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part( 'partials/hero' ); ?>
<?php endwhile; endif; ?>
<div class="full-image" <?php if ( has_post_thumbnail() ) : ?>style="background-image: url('<?php echo $background[0]; ?>')" <?php endif; ?>></div>
<section class="grid wrap">
<h2><php _e('Meet the Team','ssls'); ?></h2>
<div class="tile-grid">
<div class="row">
<?php
$loop = new WP_Query( array(
'post_type' => 'people',
'tax_query' => array( array( 'taxonomy' => 'types', 'field' => 'slug', 'terms' => 'team')),
'posts_per_page' => -1,
'order' => 'ASC'
) );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<?php get_template_part( 'partials/tile' ); ?>
<?php endwhile; wp_reset_query(); ?>
</div>
</div>
</section>
<section class="team-culture">
<h2><?php _e('Our Team Culture','ssls'); ?></h2>
<p class="subheading">
<?php _e('We work hard, but also have a lot of fun! Check out some shots of us at the office and around Boston.','ssls'); ?>
</p>
<div class="slides-container">
<div class="flexslider">
<ul class="slides">
<?php while ( have_rows('slides') ) : the_row(); ?>
<?php
$image = get_sub_field('image');
$thumbnail = $image['sizes']['grid-thumb'];
?>
<li><img src="<?php echo $thumbnail; ?>" alt="<?php echo $image['alt'] ?>" /></li>
<?php endwhile; ?>
</ul>
</div>
</div>
</section>
<section class="job-positions wrap">
<h2><?php the_field('job_positions_heading'); ?></h2>
<p class="subheading"><?php the_field('job_positions_subheading'); ?></p>
<div class="row">
<?php the_field('job_positions'); ?>
</div>
</section>
</div> <!-- end #main -->
<?php get_footer(); ?>
<?php
/* Default Hero / Page Header */
?>
<section class="hero">
<div class="text">
<?php the_content(); ?>
</div>
<a class="scroll-down" href="#"><span class="visually-hidden">Scroll Down</span></a>
</section>
<?php
/*
Expandable tile layout for staff bio's.
Displays thumbnail with name and job title. Expands to show full bio, secondary photo, and social links.
*/
?>
<?php
$photoThumb = get_field('photo_thumbnail');
$photoThumb_small = $photoThumb['sizes']['grid-thumb'];
?>
<div class="tile-container">
<div class="tile">
<div class="image">
<?php if ( $photoThumb ) : ?>
<img src="<?php echo $photoThumb_small; ?>" alt="<?php echo $photoThumb['alt']; ?>" />
<?php else :
echo get_the_post_thumbnail( $_post->ID, 'grid-thumb');
endif; ?>
</div>
<h4><?php the_title(); ?></h4>
<?php if( get_field('position') ): ?>
<span class="h6"><?php the_field('position'); ?></span>
<?php endif; ?>
</div>
<div class="tile-expand"><div class="wrap">
<div class="fourcol first">
<?php if ( has_post_thumbnail() ) :
echo get_the_post_thumbnail( $_post->ID, 'grid-thumb');
else : ?>
<img src="https://placehold.it/660x450" />
<?php endif; ?>
</div>
<div class="eightcol last">
<h4><span><?php the_title(); ?></span>
<?php if( get_field('position') ): ?>
– <?php the_field('position'); ?></h4>
<?php endif; ?>
<?php the_content(); ?>
<p class="social-links">
<?php if( get_field('twitter_handle') ): ?>
<a href="https://twitter.com/<?php the_field('twitter_handle'); ?>"><span class="icon-twitter"></span> @<?php the_field('twitter_handle'); ?></a>
<?php endif; ?>
<?php if( get_field('linkedin_name') ): ?>
<a href="https://www.linkedin.com/in/<?php the_field('linkedin_name'); ?>"><span class="icon-linkedin"></span> Linkedin</a>
<?php endif; ?>
<?php if( get_field('email_address') ): ?>
<a href="mailto:<?php the_field('email_address'); ?>"><span class="icon-envelope"></span> Email</a>
<?php endif; ?>
</p>
</div>
</div></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment