WordPress.org

Support

Support » Themes and Templates » Author name in Page Title on Author Page

Author name in Page Title on Author Page

  • I currently have it set as follows:

    <?php if ( is_author() ) { ?><? bloginfo('name'); ?>&nbsp;|&nbsp;Author Page<?php } ?>

    But I would like to have it set up so it has the authors name in the browser title rather than a generic one.

    The wordpress codex page:

    http://codex.wordpress.org/Conditional_Tags

    only shows how to pass in hardcoded values to generate this. Is there any way to do it dynamically?

Viewing 2 replies - 1 through 2 (of 2 total)
  • anyone?

    Referring to the code of function is_author in /wp-includes/query.php I would suggest something like this:

    <?php
      if ( is_author() ) {
        $author_obj = $wp_query->get_queried_object();
    ?><? bloginfo('name'); ?>&nbsp;|&nbsp;Articles by <?php
        echo $author_obj->nickname;
      } ?>

    As I did this from within a callback function I had to
    global $wp_query;
    as is also done in is_author().

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Author name in Page Title on Author Page’ is closed to new replies.
Skip to toolbar