Site logo

Archived topic

Issue with Title tag of Author archive

2 replies · Started by Bradley Wells on December 15, 2017

Viewing posts 1–3 of 3

There seems to be an issue on author archive pages when using GeneratePress with The SEO Framework plugin. The <title> tag (as seen in the browser’s tab, etc) shows html code instead of the author and site title. In my case, the title shows up as <img alt='' src='...' /> (see image below) instead of just showing author’s display name. With the plugin disabled, the title tag shows up as expected.

I opened a GitHub issue with the plugin developer, as I assumed it was on their end, but they suggest it is a bug with GP using an echo somewhere instead of a return. (I've been there!) Either way, is there some place I should look to put a temporary Band-Aid on the issue?

Here is an example page with the issue. Screenshot below

Author Archive Title Issue

Edit: TSF developer seems to have identified it as a bug in his plugin,. As I originally suspected, it's not on your end, after all. (I understand you are relying on WP to generate titles). Keep up the great work

In case anybody else runs into this issue, this snippet by The SEO Framework developer should fix it. A more robust patch should be in place in release 3.1.0.

add_filter( 'the_seo_framework_the_archive_title', function( $title, $term ) {

	if ( is_author() ) {
		$title = the_seo_framework()->use_archive_prefix( $term )
		       ? sprintf( __( 'Author: %s' ), get_the_author() )
		       : get_the_author();
	}

	return $title;
}, 10, 2 );

Glad they figured out the issue :)

This archived topic is closed to new replies.