WordPress.org

Ready to get started?Download WordPress

Forums

easy sort by author (3 posts)

  1. sasha
    Member
    Posted 9 years ago #

    It took me over a half hour of searching and playing to find this. It seems to be little known as not many WordPress sites are using it, so i'll put it here.

    This takes that "posted by authorname" text on your blog page and changes the authorname to a link. When you click the link it lists all the posts by that author.

    Change

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> —
    <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    To

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> —
    <?php the_author_posts_link(); ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    The only change is in that fourth tag, and mind the semicolon.

    You can do this manually with http://www.whatever.com/blog/index.php?author=3

    eh voila.

  2. sasha
    Member
    Posted 9 years ago #

    This is all in index.php, by the way.

  3. pschwar
    Member
    Posted 7 years ago #

    Sasha - thanks for that code, that's exactly what I needed!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.