在我的“页面标题”模板部分中有以下代码:
<?php
the_archive_title( '<h1>', '</h1>' );
the_archive_description( '<span class="archive-description">', '</span>' );
?>现在,我希望在我的页面中看到的是:
<h1>The Archive title</h1>
<span class="archive-description">The Archive description</span>但我得到的却是:
<h1>Archive title <span class="archive-description">The Archive description</span></h1>描述跨度包含在标题h1中。为什么会这样呢?
注意:我以前使用the_archive_description()使用remove_filter('term_description','wpautop');删除了p标记
发布于 2019-04-23 13:13:02
我使用@Quinn Commendant在以下线程中发布的解决方案解决了问题:https://wordpress.stackexchange.com/a/203884/160016
无论如何,上述行为都很奇怪.
https://wordpress.stackexchange.com/questions/335078
复制相似问题