easy sort by author (3 posts)

  1. sasha
    Posted 11 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.


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


    <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
    Posted 11 years ago #

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

  3. pschwar
    Posted 9 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


No tags yet.