[Resolved] Issue with Title tag of Author archive

Home Forums Support Issue with Title tag of Author archive

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #450140
    Bradley Wells

    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

    GeneratePress 2.0.1
    Bradley Wells

    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 );
    Lead Developer
    Lead Developer

    Glad they figured out the issue 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.