我做了Rarst让我做的事。首先我在Pods Framework documentation. 这解决了我的问题。
下面是代码现在的样子。
<?php
$params = array(
\'orderby\' => \'publish_date.meta_value DESC\',
\'limit\' => 10
);
$fltNewsPods = pods( \'fltnews\', $params );
while ($fltNewsPods->fetch()) {
echo "<li class=\'content-list-item\'>";
$podsForNewsItem = pods(\'fltnews\', $fltNewsPods->display( \'id\' ));
$podsImage = pods_image ( $podsForNewsItem->display( \'thumbnail_picture\'), \'full\');
if ($podsImage != ""){
$podsImage = "<div class=\'content-list-thumbnail-picture\'>" . $podsImage . "</div>";
}
printf("<a href=\'%s\' class=\'item-container\'>%s
<div class=\'content-list-body\'>
<div class=\'content-list-publisher\'>
<div class=\'date-block\'><span class=\'date\'>%s</span></div>
</div>
<div class=\'content-list-title\'>%s</div>
<div class=\'content-list-text\'>%s</div>
<div class=\'content-list-link\'>Les mer</div>
</div>
</a>",
esc_url(get_permalink($podsForNewsItem->display( \'id\' ))),
$podsImage,
getDateAsNorwegian($podsForNewsItem->field(\'publish_date\')),
$podsForNewsItem->display( \'title\' ),
$podsForNewsItem->display( \'excerpt\' ));
echo "</li>";
}
echo $fltNewsPods->pagination( array(
\'type\' => \'paginate\',
\'prev_next\' => false,
\'first_last\' => false
) );
echo "</ul>";
?>
虽然pods框架的使用率很高,但基本上是一样的。
我想这不适用于WP\\u查询版本,因为这不是一个自定义的帖子类型,所以它没有使用Wordpress框架。Wordpress不知道这些应该如何分页。