jeudi 26 février 2015

get_posts not pulling the correct number of posts


I am using the BracketPress plugin and trying to pull all of the posts of post_type brackets so I can send a newsletter blast to everyone with their current leaderboard position. However the get_posts that I am using seems to only pull half of the posts I should be pulling. Here's the code I am using.



$leaderboard_args = array(
'meta_key' => 'score',
'orderby' => 'meta_value',
'order' => 'DESC',
'post_type' => 'brackets'
);

$leaderboard = get_posts($leaderboard_args);
echo "<!--";
print_r($leaderboard);
echo '-->';


If you go to this link and view source you can see the array being outputted. The problem is, in the database there are 10 posts with post_type of brackets that have the meta_key score so I can't see any reason why they wouldn't be pulled. Even the master bracket (which should have the highest score and thus be pulled first) isn't getting pulled.


I am going to make some edits with more information as I dig through the database and try to figure this out.





Aucun commentaire:

Enregistrer un commentaire