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.7   Updated Sunday, February 22nd, 2009 at 1:13pm

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

  If you have found this page useful, please consider donating. Thanks!

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

  • 02-22-09 Version 1.7 – Added option to exclude selected categories from showing the post list (previous option was just to exclude posts in cats from being shown in the list – not where the list itself would show).
  • 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 (this option does not prevent the list from being shown on posts in those categories, but rather just the useage of categories in the list – see the option below for that).

Category IDs to not display list on

This is a comma-separated list of categories IDs for categories that you do not want the post list to display on (when using the option to show it on every post).

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: « 9 8 7 6 5 4 3 2 [1] Show All

  1. 15
    Russ

    Can i make it a specific authour? is there a switch for that?
    that way on my pages for authors i can set specific author

  2. 3stripe: Try something like this..

    Change this:

    $last_posts = $wpdb->get_results("
    SELECT ID, post_title, post_date 
    FROM {$table_prefix}posts 
    WHERE post_author = {$c_author_id} 
    {$ddpa_inc_current} 
    ORDER BY post_date
    LIMIT {$ddpa_num}
    ");

    To this:

    $last_posts = $wpdb->get_results("
    SELECT ID, post_title, post_date, post_category  
    FROM {$table_prefix}posts 
    WHERE post_author = {$c_author_id} 
    AND (
    (post_category = 10) OR
    (post_category = 20) OR
    (post_category = 30)
    )
    {$ddpa_inc_current} 
    ORDER BY post_date
    LIMIT {$ddpa_num}
    ");

    Where 10, 20, 30, etc.. are the allowed categories. :)

  3. Wow nice plugin!

    I’d also love the restrict the output to posts from specfic categories

    Keep up the good work, 3stripe.

  4. Thanks – I do appreciate it.

  5. Actually I think I have version of WP 1.5 installed somewhere. I will test it out and see if I can make it work for that too.

  6. Hi there. It wasn’t producing any content, so no visual errors.

  7. Benn: It was made for version 2.0. I could see about making it work for 1.5 as well though. What is it doing when you enable it exactly? An error message? Or is it not outputting anything at all?

  8. Which versions of WP is this for?

    Trying 1.5 and no luck.

  9. Version 1.1 has been released. The comments bug has been fixed! You can now choose to enable the plugin for all posts, or manually run it where you want. Read above for more information (in the Options section).

  10. 6
    Casey

    That would be awesome! I’d love to see it work manually, where I’d just need to put something like to get it to work.

    And yes, fixing it so the current post creates a bullet item would be nice, too.

    I really want to use this plugin and would be very happy to do so if you can fix it so that it doesn’t break the comments!

  11. I did not notice that when the current post is skipped, it still creates a list item for it. I will fix that tonight.

    Perhaps it would be best if instead of having this plugin run automatically at the bottom of every post, I set it to only run when you put in the keyword to call it up. That way it could be placed wherever you like.

    What do you think? Since you are the only one commenting so far, and I am not even using this new plugin for anything, I do not really care which method it uses ;)

  12. 4
    Casey

    This plugin seems to interfere with display of comments. When you click the comments link, you are taken to the single post page with the post and the rencent posts by author but no comments are displayed.

    I had to disable it to get comments working again. Since the plugin doesn’t allow you to manually place where it goes, this is a disaster.

  13. 3
    Casey

    OK, how can I modify the plugin code to show the post title (but not link it) for the current post? I really don’t like the “empty” bullet in the list and I’m not showing the date for each post, so it looks well, broken. Ideally, I’d like to modify the right bit of code and add a class to display this using a specific style… rather than have it just be empty.

    Your help appreciated!

  14. 2
    Casey

    OK, nevermind, I see that this automatically happens when you view a post by clicking its title. Is there someway to exclude a specific category of post (home) from being listed in the last x posts?

  15. 1
    Casey

    Are there instructions for what code to add to a category template to call the functions associated with your plugin? Thanks!

Pages: « 9 8 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.