Quantcast
Channel: WordPress.org Forums » [Yoast SEO] Support
Viewing all articles
Browse latest Browse all 41911

newtonsongbird on "[Plugin: WordPress SEO by Yoast] get_author_title() function in class-frontend.php"

$
0
0

WordPress version: 3.51
WordPress SEO version: 1.4.4

I did this: Set Author Archives title template with Force rewrite titles on.

I expected the plugin to do this: Set the author page title to what I have listed in the author title template.

Instead it did this: Set the author page title to only the author's name.

I have all of my page title templates set in the Titles & Metas section with the Force rewrite titles option set on. All of my page titles are working great EXCEPT for the author archive pages. It is ignoring my setting and only displaying the author name.

After investigating the code in class-frontend.php, I found the following (with the code in CAPS being my comments):

// Used for author titles.
   function get_author_title() {
      $author_id = get_query_var('author');
      $title = get_the_author_meta('wpseo_title', $author_id);

      if ( !empty($title) )
         // THIS IS THE CODE THAT IS SHOWING FOR ME
         return wpseo_replace_vars( $title, array() );

      // HOWEVER, THIS IS THE CODE THAT SHOULD BE DISPLAYED
      return $this->get_title_from_options( 'title-author' );
}

For some reason, if I switch the two return statements, everything is shown the way I want and expect it. I do not know if this is a bug or why this would be true.

I am using my own custom author.php file, if that factors in.

For now I have altered the code to make my page correct, but I'm concerned that this will get overwritten with updates. I would like to know if I am doing something wrong, or if it's this piece of code.

http://wordpress.org/extend/plugins/wordpress-seo/


Viewing all articles
Browse latest Browse all 41911

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>