Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created April 19, 2018 19:01

Revisions

  1. bekarice created this gist Apr 19, 2018.
    17 changes: 17 additions & 0 deletions yoast-seo-with-coauthors-plus.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?php // only copy if needed!

    /**
    * Fixes page titles for co-author archives.
    *
    * @param string[] $replacement Yoast title settings replacement data
    * @return string[] updated data
    */
    function br_fix_author_archive_title( $replacement ) {

    if ( is_author() && isset( $replacement['%%name%%'] ) ) {
    $replacement['%%name%%'] = get_queried_object()->display_name;
    }

    return $replacement;
    }
    add_filter( 'wpseo_replacements', 'br_fix_author_archive_title' );