Hi guys,
The standard code for the author template doesn't work for custom post types.
This is the code I used to solve the problem:
<?php if(isset($_GET['author_name'])) :$curauth = get_user_by('slug', $author_name);
else :$curauth = get_userdata(intval($author));
endif; ?>
<?php $authorID = $curauth->ID; ?>
<?php $post_types=get_post_types(); foreach ($post_types as $post_type ) {
$query= 'author=' . $authorID. '&post_type=' . $post_type . '&orderby=post_date&order=desc';
query_posts($query);
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endwhile; else: endif;
}
wp_reset_query(); ?>
However, I have tried to sort out pagination for this, but with no success. This is the code I have, but I am not sure how to combine it with the above.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('showposts=5'.'&paged='.$paged);
Any suggestions greatly appreciated.
Hugo