I am a plugin developer and I'm using the following function to query particular posts in wordpress in my plugin. The problem is that even when $this->params['num']
is set to something like 12, the query is only returning 6 posts. My Plugin can be found HERE.
It is working fine for me and in most cases. But i have got 2 odd support queries from users that in their case it did not work. Is it because of an older wordpress version or because of some conflict with their theme?
Here is one conflicting page (he uses WP 3.0.5)
private function lcp_set_categories(){
if($this->params['name'] != '' && $this->params['id'] == '0'){
$this->cgid = $this->get_category_id_by_name($this->params['name']);
}else{
$this->cgid = $this->params['id'];
}
$lcp_category = 'cat=' . $this->cgid;
//Build the query for get_posts()
$cgquery = 'cat=' . $this->cgid .
'&posts_per_page=' . $this->params['num'] .
'&orderby=' . $this->params['orderby'] .
'&order=' . $this->params['order'] .
'&exclude=' . $this->params['excludeposts'] .
'&tag=' . $this->params['tags'] .
'&offset=' . $this->params['offset'].
'&meta_key=' . $this->params['customfield'].
'&meta_value=' . $this->params['customfieldvalue'];
$this->cgposts = get_posts($cgquery);
}