Created
April 22, 2014 14:20
-
-
Save babelpuntocl/11181057 to your computer and use it in GitHub Desktop.
Dos loops con sticky Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Primer loop | |
<?php $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 5); query_posts( array( 'post__in' => $sticky,'caller_get_posts' => 1 ) ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
//contenido | |
<?php endwhile; endif; wp_reset_query(); ?> | |
// Segundo loop | |
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $no_sticky_args = array('post__not_in' => get_option('sticky_posts'), 'paged' => $paged ); query_posts($no_sticky_args); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
//contenido | |
<?php endwhile; endif; wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment