我正在建立一个网站,其中一个页面将是一个词汇表。词汇表的第一页将显示所有单词的列表,这些单词是分配到称为“字母”的自定义分类法中的自定义帖子类型,该分类法提取单词的第一个字母。
在词汇表的顶部,有一个“导航”,它是所有letter
s(A-Z)。然后,用户可以单击该字母,页面将显示以该字母开头的所有单词。
我的问题是,如果有一种方法可以添加current-tag
设置我当前查看的标记的样式。
到目前为止,我的代码是:
<!-- Glossary Search -->
<div class="search-container">
<div class="container">
<div class="show-search col-lg-8 col-lg-offset-3">
<form role="search" method="get" id="searchform" action="<?php echo home_url( \'/\' ); ?>">
<div class="letter-list row-fluid">
<!-- IMPORTANT --> <?php wp_tag_cloud( array( \'taxonomy\' => \'letter\', \'format\' => \'flat\', \'hide_empty\' => false) ); ?>
<input type="text" value="Search the Glossary" onblur="if (this.value == \'\') {this.value = \'Search the Glossary\';}" onfocus="if (this.value == \'Search the Glossary\') {this.value = \'\';}" name="s" id="glossarySearch" />
</div>
</form>
</div> <!-- end shows-search -->
</div> <!-- end container -->
</div> <!-- end search-container -->
非常感谢你的帮助!