【发布时间】:2013-10-25 06:09:00
【问题描述】:
我正在使用 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;?>
我到处搜索,但很难将解决方案适应我现有的代码。
【问题讨论】:
标签: wordpress sorting custom-fields alphabetical