Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // get sticky posts from DB
- $sticky = get_option('sticky_posts');
- // check if there are any
- if (!empty($sticky)) {
- // optional: sort the newest IDs first
- rsort($sticky);
- // override the query
- $args = array(
- 'post__in' => $sticky
- );
- query_posts($args);
- // the loop
- while (have_posts()) {
- the_post(); ?>
- <h2><?php the_title(); ?></h2>
- <?php the_content(); ?>
- <div style="clear:both"></div>
- <?php } wp_reset_query();
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement