问题描述
我正在使用 wordpress 插件分类法图像。我用它来获取分类图像。
从下面的代码我得到了图像和链接。我想用这些图像获取类别名称。这是我的代码。如何获取类别名称?
<?PHP
$terms = apply_filters( 'taxonomy-images-get-terms','',array( 'taxonomy' => 'category',) );
if ( ! empty( $terms ) ) {
print '<div class="row">';
foreach ( (array) $terms as $term ) {
print '<div class="col-sm-3"><a href="' . esc_url( get_term_link( $term,$term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id,' ' ) . '</div>';
}
print '</div>';
}
?>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)