/ Published in: PHP
If your site also has registered users that aren't authors, you might have to modify this to cross-reference the usermeta table. Otherwise, this should work pretty well.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? $term = $_GET['s']; if ($res) { ?> <p><strong>Were you looking for:</strong></p> <ul> <? ?> <li><a href="<? bloginfo('home'); ?>/author/<? echo $shortname; ?>/"><? echo $author['display_name']; ?></a></li> <!-- may vary based on permalink structure --> <? } ?> </ul> <? } ?>