尝试在 Wordpress 中的 post 标题下添加 ACF 字段

Trying to add an ACF field under the post title in Wordpress

我的客户正在使用 Divi 构建器主题,并要求我在类别存档页面的 post 标题下插入一个小标题。该主题使用 the_content() 将所有内容拉入页面,因此简单地在页面模板中的标题下添加一行不是一个选项。

这可能不是最好的方法,但我使用 ACF 添加了 get_field( "region" ) 并修改了此 github 中的代码。它在我需要的地方插入字段,但标题显示为 html 作为文本。我现在有一个 <br/>,但想用 <span class=""> 替换。知道为什么它不被读取为代码吗?

live example >

代码:

    function gp121028_filter_title( $title ) {
    $substrings = explode( ' | ', $title );
    $title = ( ! empty( $substrings[0] ) ) ? $substrings[0] . '<br/>' . get_field( "region" ) : $title;
return $title;

}

无法解决 - 手动构建。