Customizing an author page
-
Hi,
I’ve been struggling with customizing an author page.
How can I add the author information into the query so that the page displays only current authors’ posts?
Wouldn’t
'author' => $wp_query->get_queried_object()->ID
work? If so, where and how do I exactly put it?<?php /* Template Name: Author Template */ get_header(); $data = get_post_meta( $post->ID, 'key', true ); $category = $data[ 'portfolio-category' ]; $categoryID = get_category_id($category); ?> <div id="thumbs" class="gradient"> <ul> <?php $showPostsInCategory = new WP_Query(); $showPostsInCategory->query('cat='. $categoryID .'&showposts=1000'); if ($showPostsInCategory->have_posts()) : while ($showPostsInCategory->have_posts()) : $showPostsInCategory->the_post();?> <li> <a class="thumbLink" href="#"><?php the_post_thumbnail('fullsize', array('title' => ""));?></a> <p class="thumbTitle"><?php the_title(); ?></p> <a class="readMore" href="<?php the_permalink() ?>">Read more →</a> </li> <?php endwhile; endif; ?> </ul> </div> <?php get_footer(); ?>
- The topic ‘Customizing an author page’ is closed to new replies.