Skip to content

Instantly share code, notes, and snippets.

@asterion
Created July 24, 2017 22:20
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 asterion/4e46a87ea68492f77c813e5e3892e0c7 to your computer and use it in GitHub Desktop.
Save asterion/4e46a87ea68492f77c813e5e3892e0c7 to your computer and use it in GitHub Desktop.
prueba query_posts
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
// The Query
query_posts( 'posts_per_page=3&paged=' . $paged );
// The Loop
while ( have_posts() ) : the_post();
echo '
<li>';
the_title();
echo '</li>
';
endwhile;
// Reset Query
wp_reset_query();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment