I'm going a bit crazy on this one. I'm trying to display a list of posts in a category on an Admin page in a plugin I am writing. The following code works fine on my dev server (OS X/Apache):
$args = array(
'posts_per_page' => $pageSize,
'offset'=> $offset,
'category' => 9
);
$posts = get_posts($args);
foreach ($posts as $key => $aPost) {
(...)
}
As you might suspect, I get only posts in the category with an ID of 9. Now, on my production server (Linux/Nginx) it shows all posts - as if the category argument was never set. I only mention the nginx/apache/linux/os x as everything else is running the same - same themes and plugins installed (with the exception of Jetpack on the production server).
Any thoughts?