Skip to content

Instantly share code, notes, and snippets.

@elclanrs
Created February 13, 2013 01:03
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 elclanrs/4782705 to your computer and use it in GitHub Desktop.
Save elclanrs/4782705 to your computer and use it in GitHub Desktop.
<?
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$query = new WP_Query([
'post_type' => ['articles', 'projects', 'tips'],
'orderby' => 'date',
'posts_per_page' => 7,
'paged' => $paged
]);
?>
<? while($query->have_posts()): $query->the_post() ?>
<article class="post">
<h2><? the_title() ?></h2>
<p><? the_excerpt() ?></p>
<ul>
<? foreach($categories as $cat): ?>
<li class="category"><a href="#"><?= $cat->name ?></a></li>
<? endforeach ?>
</ul>
</article>
<? endwhile ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment