How can I skip the first post in WordPress?

How can I skip the first post in WordPress?

<?php
$recentPosts = new WP_Query();
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

Related posts

Leave a Reply

2 comments

  1. Use the offset parameter:

    <?php
    $recentPosts = new WP_Query( 'offset=1' ) );
    $recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
    ?>
    <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
    
  2. Use the offset

    $recentPosts = new WP_Query (
       array(
         'post_type'      => 'stiri',
         'post_status'    => 'publish',
         'posts_per_page' => 6, // all = -1
         'orderby'        => 'date',
         'order'          => 'DESC',
         'offset'         => 1
       )
    );