如何在存档列表页面上仅显示6个类别,如果选择的选项超过6个,则显示更多的按钮?
<?php
$terms = get_the_terms($post->ID, 'store_categories');
if ($terms && !is_wp_error($terms)):
$store = array();
foreach ($terms as $term) {
$store[] = $term->name;
}
$store_category = join(" | ", $store);
?>
<h3 id="storeCat">
<?php
$url = site_url();
foreach ($terms as $term) {
$linklist .= "<a href='" . $url . "/store_categories/" . $term->slug . "' target='_blank'>" . $term->name . "</a>" . " ";
}
echo $linklist;
?>
</h3>
<?php
endif;
?>