I have a blog with a custom taxonomy called “authors”.
On the homepage a list of all “authors” values are displayed (eg: Mark, Paul, John, etc.) using the following script:
$terms = get_terms("autors");
$count = count($terms);
if ( $count > 0 ){
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li> <a href="/autors/' . $term->slug . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a> </li>';
}
echo '</ul>';
}
Each author name is permalinked with his url to display posts of that author.
For example:
When I click them I get redirected to the archive page containing the post of that author.
I don’t want this. I simply want to get the author name.
So:
- How can I prevent the archive page from being displayed?
- How can I get the author name?
For example: if I’m on the page http://www.test.com/autors/mark, I want to get *$author_name = mark*;
Can you help me, please?
Thank you