Support » Fixing WordPress » Span Tags visible on frontend – archive title

  • After updating to 5.5.1, Span tags are appearing on the frontend when get_the_archive_title() function is called to display a category name instead of the string Category:.

    Screenshot
    https://ibb.co/tqt0MsH

    Removing the span tags here below, resolves the issue though I do not want to update core files:
    https://github.com/WordPress/WordPress/blob/master/wp-includes/general-template.php#L1721-L1729

    What can be done to resolve the properly?

    As you can see below, we do not include span tags in the banner-page.php File

    $title = get_the_title();
    if (is_archive()) {
        $title = str_replace('Category: ', '', get_the_archive_title());
    }
    if (is_single()) {
        $title = get_bloginfo('name');
    }
    ?>
    
    <?php if ($page_hero_image || $banner_image): ?>
        <div class="banner banner-small background-image" style="background-image:url(<?php echo $page_hero_image['url'] ?? $banner_image['url']; ?>)">
            <div class="banner-tint"></div>
            <div class="container">
                <div class="banner-content">
                    <div class="padding-horizontal-none">
                        <h1 class="text-gray-lightest text-shadow"><?php echo esc_html($title); ?></h1>
                    </div>
                </div>
            </div>
        </div>
    <?php endif; ?>
    • This topic was modified 7 months, 3 weeks ago by nikkins82.
    • This topic was modified 7 months, 3 weeks ago by nikkins82.
    • This topic was modified 7 months, 3 weeks ago by nikkins82.
    • This topic was modified 7 months, 3 weeks ago by nikkins82.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Span Tags visible on frontend – archive title’ is closed to new replies.