Skip to content

Instantly share code, notes, and snippets.

@marisqaporter
Last active February 25, 2016 21:51
Show Gist options
  • Save marisqaporter/0b589eacd078d6db739c to your computer and use it in GitHub Desktop.
Save marisqaporter/0b589eacd078d6db739c to your computer and use it in GitHub Desktop.
A Typical Custom Post Type Loop with Flexbox
<?php
$args = array(
'post_type' => 'mini-features', // enter your custom post type
'orderby' => 'date', // order
'feature-type' => 'web',
'posts_per_page'=> '0', // return only 1 post
);
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
echo '<div class="row">';
while( $loop->have_posts() ): $loop->the_post(); global $post;
echo '<div class="col-xs-12
col-sm-12
col-md-6
col-lg-6">';
?>
<div class="mini-feature-box">
<div class="feature_icon"><?php if( get_field('feature_icon') ): ?>
<img src="<?php the_field('feature_icon'); ?>" />
<?php endif; ?></div>
<div class="feature-text-fields">
<?php the_title( '<h3>', '</h3>' ); ?>
<p class="white"><?php the_field('feature_copy'); ?></p>
</div>
</div>
<?php
echo '</div>'; //end section inner
endwhile;
echo '</div>';
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment