Created
April 11, 2012 06:52
-
-
Save davemac/2357434 to your computer and use it in GitHub Desktop.
Show sticky posts in query
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 $args = array( | |
'cat' => 4, | |
'posts_per_page' => 4, | |
'post__in' => get_option( 'sticky_posts' ), | |
); | |
$showNewsSticky = new WP_Query( $args ); | |
while ($showNewsSticky->have_posts()) : $showNewsSticky->the_post(); ?> | |
<h2 class="small2 marginBottomQuater"> | |
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> | |
</h2> | |
<?php the_excerpt(); ?> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment