In my custom query, every time I query for posts from a particular category using WP_Query() and the category has 10 posts for example, I seem to be missing a post. So querying for 10 posts only returns 9, querying for 11 posts only returns 10 and so on. Does anyone know why I am always missing one post in my query results?
This is the code I am using that is not working. Some of my other code tests have returned the same results.
if($carouselOnOff){?>
<div id="carouselContainer">
<h2 id="sponsorsTitle"><?php echo get_cat_name( $carouselCategory ) ?></h2>
<ul id="carousel">
<?php $showPostsInCategory = new WP_Query(); $showPostsInCategory->query('cat='. $carouselCategory .'&showposts='. $carouselNumber .'');
if ($showPostsInCategory->have_posts()) : while ($showPostsInCategory->have_posts()) : $showPostsInCategory->the_post();?>
<li>
<?php $data = get_post_meta( $post->ID, 'key', true ); ?>
<a href="<?php if ($data[ 'custom_link' ]) { echo $data[ 'custom_link' ];} else { the_permalink(); } ?>">
<?php the_post_thumbnail('sponsor', array('title' => "")); ?>
</a>
</li>
<?php endwhile; endif; ?>
</ul><!--end carousel-->
</div><!--end carouselContainer-->
<?php } ?>
'cat='. $carouselCategory .'&showposts='. $carouselNumber .''
to'cat='. $carouselCategory .'&posts_per_page='. $carouselNumber .'&offset=0'
.