Skip to content

Instantly share code, notes, and snippets.

@joliveras
Last active August 29, 2015 14:02
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 joliveras/9012cc948bf8963c53fb to your computer and use it in GitHub Desktop.
Save joliveras/9012cc948bf8963c53fb to your computer and use it in GitHub Desktop.
Wordpress: Loop: Alternative Loop
<?php
$args = array(
'posts_per_page' => 3,
'cat' => 8,
'offset' => 1
);
$loop_alternativo = new WP_Query($args);
if( $loop_alternativo->have_posts() ):
while( $loop_alternativo->have_posts() ): $loop_alternativo->the_post();
the_title();
endwhile;
endif;
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment