Created
July 24, 2014 14:37
-
-
Save fernandofuly/ebcc5be9d212756854e8 to your computer and use it in GitHub Desktop.
Two Different Sticky Loops - WordPress
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
<?php $do_not_duplicate = array(); | |
$my_query = new WP_Query( | |
array( | |
'posts_per_page' => 3, | |
'post__in' => get_option( 'sticky_posts' ), | |
'ignore_sticky_posts' => true | |
) | |
); | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
$do_not_duplicate[] = $post->ID; | |
?> | |
// Conteúdo do Post | |
<?php the_title(); ?> | |
<?php break; endwhile; ?> | |
<?php | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
$do_not_duplicate[] = $post->ID; | |
?> | |
// Conteúdo do Post | |
<?php the_title(); ?> | |
<?php endwhile; ?> | |
<?php wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment