stats101
Member
Posted 1 year ago #
I currently have it set as follows:
<?php if ( is_author() ) { ?><? bloginfo('name'); ?> | 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?
stats101
Member
Posted 1 year ago #
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'); ?> | 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().