darkfate
Member
Posted 2 years ago #
I found this out while messing around with my template. It only works when your using mod_rewrite:
<?php if (is_author()) { ?>
<h2><?php $expl = explode("/",$_SERVER["REQUEST_URI"]);
$author = $expl[count($expl)-1];
echo $author."'s Posts"; ?></h2>
<?php } ?>
Slightly ineffective, but it works if you have author/name and it will grab name.
Actually, you can collect all sorts of 'author' data this way on an author query (and it should work no matter the permalink structure you use):
<?php
global $wp_query;
$curauth = $wp_query->get_queried_object();
?>
This shows the info you can then echo from the $curauth object:
http://codex.wordpress.org/Author_Templates#About_Current_Author