Skip to content

Instantly share code, notes, and snippets.

@liderdesarrollo
Last active August 29, 2015 14:06
Show Gist options
  • Save liderdesarrollo/5176eb63d858cd22d5b5 to your computer and use it in GitHub Desktop.
Save liderdesarrollo/5176eb63d858cd22d5b5 to your computer and use it in GitHub Desktop.
//Simple WPQuery filter by category Slug
<?php
wp_reset_postdata();
$args = array(
'category_name' => 'actualidad',
'orderby' => 'date',
'post_type' => 'post',
'posts_per_page' => -1
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post();?>
<div class="item">
<!-- do stuff -->
</div>
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment