Skip to content

Instantly share code, notes, and snippets.

@travisdmathis
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save travisdmathis/11321003 to your computer and use it in GitHub Desktop.

Select an option

Save travisdmathis/11321003 to your computer and use it in GitHub Desktop.
<?php
//WordPress loop for custom post type
$my_query = new WP_Query('post_type=projects&projects_categories=featured&posts_per_page=-1');
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php if ( has_post_thumbnail()) : ?>
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
<h4><?php the_title(); ?></h4>
<p><?php the_excerpt(); ?></p>
<?php endwhile; wp_reset_query(); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail()) : ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
<h4><?php the_title(); ?></h4>
<?php the_content(); ?>
<?php echo do_shortcode('[ms_grid cat=$post->page_name]'); ?>
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment