Title: skipping posts
Last modified: August 19, 2016

---

# skipping posts

 *  [stevemail](https://wordpress.org/support/users/stevemail/)
 * (@stevemail)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/skipping-posts/)
 * On [http://www.edicionsdigitals.com](http://www.edicionsdigitals.com), i Would
   to show as featured (as see with lightblue background) just the stick post (the
   first). And after, on lasts posts (next on columns below), skip the sticked post,
   showing from the next.
 * This is my index.php code:
 *     ```
       <?php get_header(); ?>
   
       <!-- BEGIN content -->
   
       <div id="content">
   
       	<!-- begin featured -->
   
       	<div class="featured">
   
       		<?php 
   
       		$tmp_query = $wp_query;
   
       		query_posts('showposts=1&cat='.get_cat_ID(dp_settings('featured')));
   
       		while (have_posts()) : the_post();
   
       		?>
   
       		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
   
       		<a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'medium', 'alt="' . $post->post_title . '"'); ?></a>
   
       		<p><?php echo dp_clean($post->post_content, 500); ?> (<a href="<?php the_permalink(); ?>">read more..</a>)</p>
   
       		<?php 
   
       		endwhile;
   
       		$wp_query = $tmp_query;
   
       		?>
   
       		<div class="break"></div>
   
       	</div>
   
       	<!-- end featured -->
   
       	<!-- BEGIN recent posts -->
   
       	<div class="recent">
   
       		<?php
   
       		if (have_posts()) :
   
       		$count = 2;
   
       		while (have_posts()) : the_post();
   
       		$count++;
   
       		?>
   
       		<!-- begin post -->
   
       		<div class="<?php if ($count==3) { $count = 0; echo 'f '; } ?>post">
   
       			<p class="category"><?php the_category(', ') ?>&raquo;</p>
   
       			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
   
       			<a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
   
       			<p>Wall street has finally gotten the piece of economic news it has been waiting for: the battered labo</p>
   
       			<p class="date">Monday, 7 December 2009</p>
   
       			<p class="comments"><a href="#">Comments</a></p>
   
       		</div>
   
       		<!-- end post -->
   
       		<?php endwhile; ?>
   
       		<p class="postnav">
   
       			<?php next_posts_link('&laquo; Older Entries'); ?> &nbsp; 
   
       			<?php previous_posts_link('Newer Entries &raquo;'); ?>
   
       		</p>
   
       		<?php else : ?>
   
       		<div class="notfound">
   
       			<h2>Not Found</h2>
   
       			<p>Sorry, but you are looking for something that is not here.</p>
   
       		</div>
   
       		<?php endif; ?>
   
       		<div class="break"></div>
   
       	</div>
   
       	<!-- END recent posts -->
   
       </div>
   
       <!-- END content -->
   
       <?php get_sidebar(); get_footer(); ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [stevemail](https://wordpress.org/support/users/stevemail/)
 * (@stevemail)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/skipping-posts/#post-1488559)
 * Self-Solved. Adding this:
 *     ```
       // query_posts('showposts=1&cat='.get_cat_ID(dp_settings('featured')));
   
                       $sticky=get_option('sticky_posts') ;  // Llistar post fixat
   
                       query_posts('p=' . $sticky[0]);       // id. anterior
       ```
   
 * And those lines, on the second case:
 *     ```
       $args = array(
       	'posts_per_page' => 9,
       	'post__not_in'  => get_option('sticky_posts'),
       	'caller_get_posts' => 1
       );
       query_posts($args);
       ```
   
 * Steve,

Viewing 1 replies (of 1 total)

The topic ‘skipping posts’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [stevemail](https://wordpress.org/support/users/stevemail/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/skipping-posts/#post-1488559)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
