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.92   Updated Tuesday, July 7th, 2009 at 6:18pm

Latest Post from each Category plugin for WordPress

This plugin displays a list of the latest post from each category of your WordPress installation. It can be added to a post or page, or used directly in a template file. In the plugin’s options page you can choose the sort order, show or hide the dates, select the date formatting, show the first X characters of the content, display a link to the comments, and show comment counts, as well as other options.

Download

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

Installing

  • 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 DDLatestFromEach).

Using

There are two ways you can use this plugin.

1) In a post or page, insert the following line:

<!-- ddlastfromeach -->

2) In a template file, insert the following code:

<?php echo dd_last_from_each(); ?>

Change Log

  • 07-07-09 Version 1.92 – Slight change to the way the list is displayed.
  • 07-06-09 Version 1.91 – You can now choose how many posts per category to display.
  • 02-19-09 Version 1.9 – Added option to use only selected categories.
  • 08-14-08 Version 1.8 – Tested with WordPress 2.6. Now uses WordPress function for determining date/time to show up to date posts. Added option to exclude categories.
  • 09-27-07 Version 1.7 – Updated to support WordPress 2.3. Added ‘Load Default Options’ button.
  • 05-31-07 Version 1.6 – Better support for international date formatting
  • 05-16-07 Version 1.5 – Updated for WordPress 2.2
  • 02-20-07 Version 1.4 – Updated for WordPress 2.1 (new pages were showing up in the default category)
  • 08-09-06 Version 1.3 – Added options to show comment links and counts. Also added an optional limit to the number of links shown, and a few other fixes.
  • 06-03-06 Version 1.2 – Added an option to turn category names into links. A bug was also fixed where extra slashes were being shown in the header text.
  • 05-31-06 Version 1.1 – You can now choose the sort order of the output, hide password-protected posts, and show the first X characters of the content after each post. A few other fixes have been made as well.
  • 05-30-06 Version 1.0 – First release.

Demo

Here you can see the plugin in action:

Latest Post From Each Category

Options

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

Header text

This is shown above the list of posts.

Sort order

You can choose to have the data sorted by category or date. You also have the option of ascending or descending on both.

Show link to comments

When enabled, this will add a link to the comments for each post listed.

Include number of comments

This option only applies if Show link to comments is enabled. It adds the number of comments to the comment link.

Include link for posts with no comments

This option only applies if Show link to comments is enabled. It allows you to include or hide the comment link for posts with no comments.

Turn category names into links

Enabling this option will turn category names into links to the categories.

Hide password-protected posts

This prevents password-protected posts from showing up.

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)

Show first X characters of posts

This allows you to show a preview of the content under each post in the list.

Number of characters to show

This lets you specify how many characters of the content will be shown, assuming you have the previous option enabled.

Limit list to X categories

This allows you to set a limit on the number of categories that will be shown in the list. Set to 0 for no limit.

Excluded category IDs

This is a comma-separated list of category ID’s you want excluded from the list.

Included category IDs

This is a comma-separated list of category ID’s you want to use in the list. This option only applies if you are not using the excluded category IDs option.

Max posts per category

If you would like to show more than one post per category, you can change the number here. To display all posts, use 0.

Pages: « 2116 15 14 13 12 [11] 10 9 8 7 61 » Show All

  1. 165
    Sal

    Thanks for providing this. Very useful. :) I’d like to use it on different pages of a site to only show one different category per site page, rather than list all categories. Is this possible?

  2. 164
    Jono2009

    Great work on the plugin, thank you! Is it possible to have it display the last {x} articles from each category as well?

    Thx!
    Jon

  3. 163
    monti

    How to sort names of categories in alphabetical order of wp admin panel-manage categories

  4. 162
    FraZ

    Hi
    great plugin, it’s working fine on my site.
    I suggest to give administrators the possibility to exclude some category i.e. i want to show all cats except that with id 3,8 and 11.
    bye

  5. Viceer: You just have to enable the option to show an excerpt for each post.

  6. Hi, I am new with WP and planning to use it in our Uni. Your plugin it just the right one we’ve been looking for.

    How can i possibly use the options… (sorry, i am new with WP)? I like to show the latest post for each category with some few lines in every post. Like:

    Category #1
    =======

    POST TITLE
    date posted

    Some few lines of the post.

    Another Category
    ===========

    POST TITLE
    date posted

    Some few lines of the post.

    Help/Suggestion is much appreciated..

  7. Hello,

    I really love this plugin, it works exactly as i wanted it to.
    but there is one very small problem, I want my main page to display the entire posts. but the format does not seem to follow the template, they crumple up and lose all the format

    here’s my website http://www.sheeply.com
    the 1st post is by the plugin, the second post is the original post. Is there anything i can do so that it adds the and other formats into the plugin generated posts so that it looks like the second (the original) post?

    Thank you very much!

  8. 158
    abu

    Great plugin, thanks
    Is it possible to show post-contents including the post-image and the text limited to the [ more...] quicktag?
    I’ll appreciated if anybody have a clue.
    Thanks

  9. Hey,

    Great plugin, exactly what i was looking for. I was just wondering if i could add a line before each category (after the content is displayed.) I’m kind of new to the coding thing and was hoping you could tell me what to modify in the plugin code.

    Thanks

  10. rdentry: It sometimes takes a little while before the new posts appear due to the way the plugin checks for future-dated posts.

  11. Huh, weird… the two parameters should be

    title_li=&depth=1&sort_column=menu_order

    and

    title_li=&depth=1&sort_column=menu_order&exclude=1466

    where the number corresponds to the ‘latest’ page.

  12. Update: I’ve done that now, by editing header.php

    <?php wp_list_pages('title_li=&depth=1&sort_column=menu_order'); ?>

    becomes:

    
    <?php if (function_exists('dd_last_from_each')) {
          wp_list_pages('title_li=&depth=1&sort_column=menu_order');
           } 
      else {
             wp_list_pages('title_li=&depth=1&sort_column=menu_order&exclude=1466');
           } 
    ?>

  13. Thanks for the nice plugin, here’s what I’ve done with it.

    1) I made a new page, ID number 1466, containing the following text:

    “This page displays the latest post along in every category on this site.

    If you’re reading this, either the plugin is disabled (maybe I am mid-upgrade), or I’ve simply messed up! If so, please let me know using the form below!”

    2) I updated the ‘page’ template

    				<?php if (have_posts()) : ?>
    				<?php while (have_posts()) : the_post(); ?> <!-- These two lines were existing code, for context -->
    <?php if (($post->ID==1466) and (function_exists('dd_last_from_each'))) : 
    echo dd_last_from_each(); 
    ?> 
    				<?php else : ?>

    and, before endwhile <?php endif; ?>

    3) Now, if the plugin isn’t available, the page will display an apology, and if it is available it’ll show the plugin results.

    4) My final step will be to hack the page links to not show the link to the page if the plugin is unavailable.

    Thanks.

  14. 152
    rdentry

    This plug-in is working wonderfully except for the fact that when I test it, by writing a new post, it does not show the most recent test post after I publish and refresh. I believe that others have had this problem, but the solution has been exchanged via email. Any help would be appreciated.

  15. Amber: Because of the way this plugin checks the post dates, new ones do not always show up instantly.

    Marc: Thanks, I will make the modifications.

Pages: « 2116 15 14 13 12 [11] 10 9 8 7 61 » 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.