我正在使用 WordPress 自定义内容类型管理器来构建一个文学机构网站。
我坚持的页面是作者页面,它显示与作者相关的所有书籍的缩略图。我下面的代码就是这样做的,但是我希望它按字母顺序显示。这是代码:
<?php if (get_custom_field("authimage:get_post")):?>
<div class="thumbstrip">
<h4>Titles by this Author</h4>
<ul>
<?php $my_post = get_custom_field("authimage:get_post");
if(!empty($my_post)){
foreach ($my_post as $a) {
print '<li><a href="'. $a['permalink'] .'" title="'. $a['post_title'] .'"><img src="'.$a ['thumbnail_src'].'" /></a></li>';
}
}
?>
<ul>
</div>
<?php endif;?>
我到处搜索,但很难将解决方案适应我现有的代码。