我正在使用以下功能根据他们的投票获得一些帖子(投票插件):
function top_voted($number){
$a = SortVotes();
echo \'<div class="voted">\';
$rows = 0;
//Now do not include deleted posts
$i = 0;
while ($rows < $number) {
if ($a[0][$i][0] != \'\') {
$postdat = get_post($a[0][$i][0]);
if (!empty($postdat)) {
$rows++;
echo \'<div class="fore">\';
echo \'<div class="votecount" style="width: 1em; color: #555555; font-weight: bold;">\'.$a[1][$i][0].\' </div><div><a href="\'.$postdat->guid.\'" title="\'.$postdat->post_title.\'">\'.$postdat->post_title.\'</a></div>\';
echo \'<div class="votecount" style="width: 1em; color: #555555; font-weight: bold;">\'.$a[1][$i][0].\' </div><div>\'.$postdat->post_content.\'</div>\';
echo \'</div>\';
}
}
if ($i < count($a[0])) {
$i++;
} else {
break; //exit the loop
}
}
echo \'</div>\';
}
我只想得到某种职位类型的职位。我想我得做点什么get_post
但我对它不熟悉。有什么建议吗?