最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - How to display the_archive_title() and the_archive_description() - "weird" interaction

programmeradmin1浏览0评论

I've got the following code in my "pagetitle" template partial:

<?php
the_archive_title( '<h1>', '</h1>' );
the_archive_description( '<span class="archive-description">', '</span>' );
?>

Now, what I expect to see in my page is this:

<h1>The Archive title</h1>
<span class="archive-description">The Archive description</span>

But instead I've got this:

<h1>Archive title <span class="archive-description">The Archive description</span></h1>

The description span enclosed inside the title h1. Why is that?

Note: I've previously removed the p tag from the_archive_description() using remove_filter('term_description','wpautop');

I've got the following code in my "pagetitle" template partial:

<?php
the_archive_title( '<h1>', '</h1>' );
the_archive_description( '<span class="archive-description">', '</span>' );
?>

Now, what I expect to see in my page is this:

<h1>The Archive title</h1>
<span class="archive-description">The Archive description</span>

But instead I've got this:

<h1>Archive title <span class="archive-description">The Archive description</span></h1>

The description span enclosed inside the title h1. Why is that?

Note: I've previously removed the p tag from the_archive_description() using remove_filter('term_description','wpautop');

Share Improve this question edited Apr 23, 2019 at 12:03 Pratik Patel 1,1111 gold badge11 silver badges23 bronze badges asked Apr 23, 2019 at 10:30 Paolo SacchettiPaolo Sacchetti 238 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I've solved using the solution posted by @Quinn Commendant in the following thread: https://wordpress.stackexchange/a/203884/160016

In any case, the above behaviour is weird...

发布评论

评论列表(0)

  1. 暂无评论