| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Template Name: Default |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
|
| 9 |
$term_permalink = BetterDocs_Helper::term_permalink('doc_category', $term->slug); |
| 10 |
|
| 11 |
$html .= '<a href="' . $term_permalink . '" class="el-betterdocs-category-box-post"> |
| 12 |
<div class="el-betterdocs-cb-inner">'; |
| 13 |
|
| 14 |
if ($showIcon) { |
| 15 |
$cat_icon_id = get_term_meta($term->term_id, 'doc_category_image-id', true); |
| 16 |
|
| 17 |
if ($cat_icon_id) { |
| 18 |
$cat_icon = wp_get_attachment_image($cat_icon_id, 'thumbnail', ['alt' => esc_attr(get_post_meta($cat_icon_id, '_wp_attachment_image_alt', true))]); |
| 19 |
} else { |
| 20 |
$cat_icon = '<img src="' . BETTERDOCS_ADMIN_URL . 'assets/img/betterdocs-cat-icon.svg" alt="betterdocs-category-box-icon">'; |
| 21 |
} |
| 22 |
|
| 23 |
$html .= '<div class="el-betterdocs-cb-cat-icon">' . $cat_icon . '</div>'; |
| 24 |
} |
| 25 |
|
| 26 |
if ($showTitle) { |
| 27 |
$html .= '<' . $titleTag . ' class="el-betterdocs-cb-cat-title">' . $term->name . '</' . $titleTag . '>'; |
| 28 |
} |
| 29 |
|
| 30 |
if ($showCount) { |
| 31 |
if ($term_count == 1) { |
| 32 |
$html .= '<div class="el-betterdocs-cb-cat-count"><span class="count-prefix">'.$prefix.'</span>'.$term_count.'<span class="count-suffix">'.$suffixSingular.'</span></div>'; |
| 33 |
} else { |
| 34 |
$html .= '<div class="el-betterdocs-cb-cat-count"><span class="count-prefix">'.$prefix.'</span>'.$term_count.'<span class="count-suffix">'.$suffix.'</span></div>'; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
$html .= '</div> |
| 39 |
</a>'; |
| 40 |
|