I'm having a bit of a problem here... I have 4 authors on my website, and I'd like to have both a page listing all authors and their description, bio, website, etc., and also a page listing one of the author with all of their posts. It seems I can't do it on the same page, because the template author.php needs the slugname to be passed to display something...
What would be a good solution would be to tell this author.php that if no slugname is passed, it should display the list of authors, but if the user actually clicks on one of the authors' name in a post, he should be able to see this particular author's page.
What I have so far is a mix of both, and I can't do any if statement since I don't know how to "tell" the script that if no user is specified, it should display only the list...
I'm getting crazy with this. Please don't tell me to use a plugin, this is for a mobile theme, I'm using any theme switcher, so if I enable a plugin, it will enable it for the desktop version, and this one is perfectly fine right now and doesn't need any change.
My code for the author.php page. The theme is Brunelleschi, not that it really matters, but who knows. I was kinda hoping I could do a "authors.php" page, but no luck there.
<?php /* Template Name: Auteur */ get_header(); ?> <h1>Liste des auteurs :</h1><?php wp_list_authors('show_fullname=1&optioncount=1&orderby=post_count&order=DESC&number=4'); ?> <!-- This sets the $curauth variable --> <!-- that's where I would like to put my if statement, so that it displays only the above when no specific author is selected --> <?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?> <div id="content" class="<?php echo $curauth->user_nicename; ?>"> <h1><?php echo $curauth->nickname; ?></h1> <dl> <dt>Site internet : </dt> <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd> <dt>Biographie : </dt> <dd><?php echo $curauth->user_description; ?></dd> </dl> <h2>Les articles de <?php echo $curauth->nickname; ?> :</h2> <ul> <!-- The Loop --> <?php query_posts( $query_string.'&showposts=9999'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php the_title(); ?></a>, <?php the_time('d M Y'); ?> dans <?php the_category('&');?> </li> <?php endwhile; else: ?> <p><?php _e('Aucun article trouvé pour cet auteur.'); ?></p> <?php endif; ?> <!-- End Loop --> </ul> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>