我正在尝试设置从用户输入的每个类别标签生成的自定义按钮的样式。这是当前的样子:

html - 在Wordpress中使用the_category()自定义Bootstrap按钮样式-LMLPHP

它应该是这样的:

html - 在Wordpress中使用the_category()自定义Bootstrap按钮样式-LMLPHP

这是按钮样式的地方,包括the_category();。标记(样式发生在后类型和后类型文本类中):

<button type="button" class="btn btn-outline-secondary post-genre"><span class="post-genre-text"><?php the_category(', '); ?></span></button>


感谢您提供任何帮助!

最佳答案

您应该遍历类别,而不是将类别拆分为一个按钮。

Looping through categories

07-28 01:14
查看更多