Sobek`s Posts by Author Plugin
Sobek`s Posts by Author plugin is a Wordpress 2.3+ plugin, which allows you to list the posts and pages written by one or more authors.
“Can do” statements
- Can display the posts and pages written by one or more authors as joint or seperate lists
- Can sort the output by post title, date or number of comments
- Can display the number of posts that were listed in one call and the number of comments for each post
- Can be called multiple times in a single page or post
Requirements
- Wordpress 2.3 or above
- PHP Exec plugin or similar to be able to make php calls within pages or posts
Download
- Download the latest version
Version history
- v1.0.1 (November 14th, 2007) – fixed bug that would dispaly all posts instead of those by the selected author(s)
- v1.0 (October 31st, 2007) – basic working version
Installation
- unzip downloaded file
- upload sobeks_posts_by_author.php to your “wp-content/plugins” folder
- enable the plugin on the “Plugins” tab in your administration area
Basic usage
- enter
<?php sobeks_posts_by_author(xyz) ; ?>
anywhere on your page you want the list of posts to be displayed
- replace “xyz” with the ID of the author whose posts you want to display eg.
<?php sobeks_posts_by_author(3) ; ?>
to list the posts of more than one author as one list replace xyz with a comma separated list of author IDs eg.
<?php sobeks_posts_by_author(3,1,5) ; ?>
- enclose the function call with “<ul>” and “</ul>” eg.
<ul><?php sobeks_posts_by_author(3,1,5) ; ?></ul>
- Repeat steps 1-3 for as many seperate author listings as you need
Advanced usage
Sobek`s Posts by Author plugin currently supports the following tags. If you choose not to use them, a built-in default value will be used in their place (i.e. nothing will break):
- “title” / “date” / “commentsort” – sorts the output by title, date or number of comments. Defaults to “title” eg.
<?php sobeks_posts_by_author(3,1) ; ?>
will produce the same result as
<?php sobeks_posts_by_author(‘title’,3,1) ; ?>
whereas this call will produce the same list of posts sorted by date:
<?php sobeks_posts_by_author(‘date’,3,1) ; ?>
and this call yet again the same posts, this time sorted by “most commented”:
<?php sobeks_posts_by_author(‘commentsort’,3,1) ; ?>
- “count” / “nocount” – hides or shows the number of posts displayed in one call. If shown the “number of posts” information is the first item of the list displayed. Defaults to “nocount” eg.
<?php sobeks_posts_by_author(3,1) ; ?>
will produce the same result as
<?php sobeks_posts_by_author(‘nocount’,‘title’,3,1) ; ?>
whereas this call will produce the same list with the first list item being an information about how many posts are displayed:
<?php sobeks_posts_by_author(‘count’,3,1) ; ?>
- “comments” / “nocomments” – hides or shows the number of comments to a post. Defaults to “nocomments” eg.
<?php sobeks_posts_by_author(3,1) ; ?>
will produce the same result as
<?php sobeks_posts_by_author(‘nocomments’,‘title’,3,1) ; ?>
whereas this will display the same list with the number of comments shown i brackets after the link to a post:
<?php sobeks_posts_by_author(‘comments’,3,1) ; ?>
Examples
- The sitemap of this page here (scroll down to the heading “Łukasz Sobek”, the posts are ordered by date)
CSS Styling
To style the output of the list just assign a class or ID to the “<ul>” tag eg.
<ul class=”helpful”><?php sobeks_posts_by_author(3,1) ; ?></ul>
and modify your wordpress css file to style the entries of the list.
PS. If you want an ordered list, you my want to enclose the call within <ol> tags eg.
<ol><?php sobeks_posts_by_author(3,1) ; ?></ol>
Related plugins
- Wp-authors provides an “Authors” widget in the sidebar, useful for identifying all the different authors in a multi-author blog.
- Authornotify is a wordpress plugin to show a message box in all the posts by a particular author.
Worth reading
- Using Author Template Tags Outside of the WordPress Loop by Lorelle
- How-to style WordPress author comments by Derek



7:04 pm
Jörg
Hey,
great plugin.
Unfortunately it always lists all posts from all authors when I attempt to write out only the posts for a specific author.
I have 3 authors and only want to list the posts from author id=1. My code:
7:05 pm
Jörg
Ok – cut off the code:
Any idea, what could go wrong?
7:07 pm
Jörg
I’m using ‘date’, 1
8:22 pm
Łukasz Sobek
hmmm, say, is the admin user with ID 1 co-author of all posts?
2:21 pm
tjiN’z
Hei Sobek, you have a nice plugin there.
However, I am facing similar problems as Jorg is.
2:43 pm
tjiN’z
Hmm, does you site require you to approve comments? My comment doesn’t seem to appear!
6:31 pm
Łukasz Sobek
@#6
Yes it does.
@Jörg & tjiN’z
I’ll look into the problem soon.
11:03 pm
Jörg
no. author ID 1 isn’t co-author of the posts. there’s only one author / post. hope u can find a solution. thanks for your time + work.
12:36 am
Łukasz Sobek
Jörg and tjiN’z: Thank you, I believe the problem is now solved :)
9:30 pm
Jörg
Awesome! Works :)
Could you actually add another tag, to also write out the post date?
10:14 pm
Łukasz Sobek
The Posts by Author plug-in will have possibilities similar to the Posts in Category plug-in (omitting, of course, the author display :)
3:12 am
Hedley
The download link (http://wordpress.sobek.pl/wp-content/uploads/2007/11/sobeks_posts_by_author_v1_0_1.zip) doesn’t work. Is this still available anywhere, and if so, is it still working with current WP versions?
11:44 pm
Łukasz Sobek
@Hedley – As stated: wordpress 2.3+. Thank you for the information – the download link is fixed.
11:57 pm
Hedley
Thanks for the reply. Just FYI: The link “http://wordpress.sobek.pl/wp-content/uploads/2007/11/sobeks_posts_by_author_v1_0_1.zip” still does not work for me, but if I change it to “http://clockworkblogger.com/wp-content/uploads/2007/11/sobeks_posts_by_author_v1_0_1.zip” it DOES work.
Regards,
HB
11:08 pm
Łukasz Sobek
@Hedley – Finally fixed.
3:14 pm
indogear
thanks….nice post
6:37 am
ingrid
I understand that your plugin lists the authors with their posts, but does it also permit each author’s name to show with each post he/she writes?
I’d like each post by each author to have a byline: by Name of Author. is this possible? thanks, ingrid