Skip to content

Instantly share code, notes, and snippets.

@elclanrs elclanrs/test.php
Created Feb 13, 2013

Embed
What would you like to do?
<?
$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
You can’t perform that action at this time.