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

  1. Is there a way to display posts by passing it the author id? I want to display posts on author bio pages, so it is outside of the wp loop.

    Thanks!

  2. Good plugin, but it includes pages within its listing, not just the posts. If you don’t want the pages to show up (like your about page, or your contact page or any other page you create), then simply add AND post_type = ‘post’ within the codes implementation where the SQL query is written.

  3. Google Tutor: You can try using the following code directly in your single.php file – just make sure you add it somewhere in the loop:

    <?php echo ddpa_show_posts(); ?>

  4. how can I control where this is output onto single.php? I want to put some share icons before the links and can’t figure out how…

  5. Travis: Check your email :)

  6. Awesome plugin! It is exactly what I have been looking for! Now I might get a swift kick to the nuts for this but… I just have a syntax question. I am creating a photoblog and want to include the thumbnail images in the “last X posts” lists. With the plugin I am using for the images, the code I use to get a thumbnail in the loop is:

    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">					
    <?php if ($post->image): ?>
    <img src="<?php echo $post->image->getThumbnailHref(array('w=100','h=100','q=95','wp=100','hl=100','zc=1')) ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>"  />
    <?php endif ?>
    </a>

    Now what I want to do is have that included in the output section of your plugins code, which I am guessing by looking at the code is:

    
    	if (count($last_posts) > 0) {
    
    		$the_output = NULL;
    
    		$the_output .= $ddpa_header;
    
    		$the_output .= "<ul>";
    
    		foreach ($last_posts as $lpost) {
    
    			$the_output .= '<li><a href="' . get_permalink($lpost->ID) . '">' . $lpost->post_title . '</a>';
    
    			if ($ddpa_show_date) {
    				$the_output .= ' - ' . date($ddpa_date_format, strtotime($lpost->post_date));
    			}
    		
    			$the_output .= '</li>';
    
    		}
    
    		$the_output .= "</ul>";
    
    	}
    
    	return $the_output;
    
    }
    

    Now the problem is, that I don’t know PHP syntax. Can somebody throw me a bone here? Thanks in advance. Once again, Awesome plugin!

  7. Hi!

    Is there any way for pages to be excluded from the listing of recent posts at the bottom of each post? I have only posted one entry to the blog, but have created numerous pages. Those pages are showing up at the bottom of the one post as recent posts. Is there a way to get rid of them?

    Thanks,
    Celia

    Note: http://www.pinkchairdiaries.com is a site not intended for individuals under the age of 18.

  8. daniele: It should not be showing them, since this is in the SQL: ‘AND post_date < NOW()’

    Unless it is still showing posts that are only a few hours in the future, in which case it could have to do with the time setting in WordPress matching up with your server’s time.

  9. Hi,

    I have the future-dated posts shown in the recent posts menu. Is it possible to get the future-dated posts not shown in the sidebar?
    Thanks for helping.

  10. Rod: Perhaps in the future. Currently this plugin generates a list of posts from the author of the current post, so it has to run inside the loop.

  11. Like some of your plugins (which are all great, incredible) : the possibility to have an option to put the result non only inside the post :(

  12. Jim: Find this line:

    $ddpa_header = str_replace('%A', $author_info->display_name, $ddpa_header);

    And after it, add this:

    get_author_profile($c_author_id);
    
    $ddpa_header = str_replace('%FN', author_profile('firstname', false), $ddpa_header);
    
    $ddpa_header = str_replace('%LN', author_profile('lastname', false), $ddpa_header);
    

    Then use %FN and %FL for first and last.

  13. 63
    Jim Kimmons

    Ref my previous comment, I got the posts to show up by using ddAddSig and placing as the sig. Works great. However, instead of using %A in the ddpostsbyauthor plugin, how would I get first and last name to show instead of the author nickname? Tried %FIRST, %F, etc.

  14. I’ve used the plugin before and it was fine. New blog using Anaconda theme. Installed the plugin and activated. I’ve played with all the settings, but nothing shows at the bottom of the posts for admin or a test author. Test site above.

  15. 61
    Cent

    Hi Admin. After much trial and error, I actually got some workable code going. Had to create a Page which runs some PHP code. Thanks. Took a look at your other plugin for a different purpose and ran into a wall. I’ve posted on that forum about it.

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