Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.6   Updated Wednesday, September 26th, 2007 at 5:17pm

Posts by Author Plugin for WordPress

This plugin will show the last X posts by the current author either at the bottom of every post, or where you manually specify in each post. Using the built-in options page, you can choose the number of posts to show, set the header text, choose to show the post dates, select the format of the date, and choose whether or not to include the current post in the list. Other options have been added since the first release.

Download

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory.
  • Enable the plugin.
  • Configure the plugin options (under DDPostsByAuthor).
  • Test it out by viewing a post.

Change Log

  • 09-26-07 Version 1.6 - Updated for WordPress 2.3. ‘Load Default Options’ button added. Fixed bug where pages would sometimes be listed.
  • 05-16-07 Version 1.5 - Updated for WordPress 2.2.
  • 05-22-06 Version 1.4 - The author’s ‘display name’ is now shown instead of their login name. Also, future-dated posts no longer show up in the lists.
  • 05-21-06 Version 1.3 - A bug was fixed where posts would show up multiple times if they were in multiple categories.
  • 04-19-06 Version 1.2 - Option added to sort posts by date - newest or oldest first. I have also added support for category exclusion. So posts from specified categories will not show up in the recent post lists. A bug was also fixed where the list would also include pages and attachments. It now just shows published posts.
  • 04-05-06 Version 1.1 - Comments bug fixed - they will now work properly when this plugin is enabled. Added option to enable/disable post list on every page. You can also now call the plugin manually in a post. A few other fixes as well, including a new option to include the current post in the list.
  • 03-30-06 Version 1.0 - First release.

Options

Here are the options available in this plugin’s options page in the WordPress admin panel.

Show at the bottom of every post

If enabled, this plugin will generate its data at the bottom of every post, before the comments section.

NOTICE: No matter what you have this set to, you can also manually call this plugin by entering the following line where you want the data to be shown in your post:

<!-- ddpostsbyauthor -->

Number of posts to show by author

This is the number of posts by the current author that will be shown at the bottom of each post.

Text to show before list

This is the header for the post list. If you want to use the author’s name in this text, use %A.

Category IDs to exclude from post lists

This is a comma-separated list of categories IDs you want to exclude from the recent post lists.

Show date after listed posts

This will show the post date after each post in the list.

Date format

If you are showing the date after posts, this will allow you to configure the date format (using the standard PHP date() format)

Include current post in list

This sets whether or not the post being viewed should show up in the list of recent posts by the current author.

Show newest posts first

If checked, this will show the newest posts first in the list. If not checked, it will show the oldest posts first.

Pages: « 7 6 5 4 3 [2] 1 » Show All

  1. The Technocrat: Thanks, that saves me from having to look it up :)

    And don’t worry, I always like suggestions. :) I get quite a lot of them and cannot possible add in every feature possible to every script, but I try to always implement things that fix bugs and improve the functionality :)

  2. cool man… I’ll give you a head start:

    In WP2.0, the wp_users table contains the user’s login (system) ID at user_login. The records also contain values at user_nicename and display_name. I’m going to guess you’re using a call out to the record: where user_login=post_author, display user_login. If it were me, I would make it easy on myself and do: where user_login=post_author, display display_name.

    :-)

    Again, I hope you don’t think I’m all like: “DO MY BIDING ALEISTER!”, just trying to help the plugin’s development over here…

  3. The Technocrat: Ah yes. I keep forgetting about future posts on some of these plugins. I thought I had added the check in but I guess not. I will fix it when I get home today, and also make sure it shows the actual ‘display name’ field :)

  4. ah ha..that should have been obvious, sorry I didn’t notice.

    about the name, if you go in the user preferences page of WP, every author gets the option of how they want their name displayed. SO basically, John Doe can have the login id ‘jdoe’ with the password ‘password’, but when they write a post they cn have their name displayed as ‘JDoe’ or John Doe’ or ‘John the computer guy’ or whatever. For example. you could go in there and although you can’t change your login ID from Admin, you could make the name displayed throughout your blog be ‘Admin the plugin guy’, and it would be changed everywhere on your blog. So basically, the plugin is pulling the author name from the ID field, and not the preferred display name field. I can tell, because my login ID is ‘technocrat’, but I have my display name set as ‘The Technocrat’. http://geeklimit.com/technocrat/last-10-posts/

    Also, I just made a post that is post-dated for July 4, and it shows up in the list. You might want to put a conditional statement in the loop so that when the post date > today(), don’t put in the display array…

    I don’t mean to dump all of this on you, I could do it myself, but I figure it’s smarter to keep the plugin the same and come out with new revisions, than just have me change this stuff and release it as a branch…

  5. Version 1.3 has been released. It fixes a bug where posts would show up multiple times if they were in multiple categories.

  6. The Technocrat: Ah. The duplication problem happens when posts are in multiple categories. I will fix :) Also, where is it showing you the ID instead of the display name? Your site looked fine to me, unless I missed it.

  7. also, note that the plugin displays the author’s login ID, instead of their preferred display name… just fyi…

  8. sorry, forgot to check ‘notify me of replies’…

    here’s an example…also, it appears that they’re coming up more than twice on some posts…?

    http://geeklimit.com/technocrat/

  9. Ah yes.. hiding future dated posts would be a good idea.

    You said some of your posts show up twice.. any idea why? Or can you show me an example?

  10. I’m trying to use the plugin… It displays posts I have scheduled for publishing at a future date… I don’t want these posts available until the date I set, so that gets a little undermined…

    Alao, this plugin displays some of those posts twice, but not all of them.

    Should be a simple addition for version 1.3 to say that if post-date > today(), do not show…

  11. Version 1.2 has been released!

    Option added to sort posts by date - newest or oldest first. I have also added support for category exclusion. So posts from specified categories will not show up in the recent post lists. A bug was also fixed where the list would also include pages and attachments. It now just shows published posts.

    Neil: There was a problem with the code I showed you. The new category exclusion feature should work nicely for you.

    Benn: I just tested this plugin with WordPress 1.5 and it seemed to work fine. Maybe another plugin is conflicting with it.

    Russ: I just added a new plugin that will do what you want - Other posts from Cat

  12. Admin,

    I tried the code substitution that you posted below because I want to be able to limit which categories are shown, an it is giving me an error on line 179. Am I doing something wrong?

  13. It is very possible. It should be an easy rewrite of this plugin.

  14. 17
    Russ

    This is cool, thanks, is there anyways to have one of this for a last 5 post by category?

  15. The easist way would be to set that author as the author of that page.

Pages: « 7 6 5 4 3 [2] 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.