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

  1. Kim:

    Yes you can. You will probably need to define some sort of variable and then place that in the SQL query.

    place something simialr to this around line 223 after the switch for ddle_sort and before the closing }

    
    php global $ user_identity, $ user_level; get_currentuserinfo(); if  ( 
    $ user_identity) {
                    if ($ user_level &gt; = 8 ) {
                       $level = "AND { $ table_prefix }categories . cat_ID 3 ) 
                    }
    

    you really dont need an else, because everything else is already display, unless you have something else in mind.

    then down in the SQL query you will need to add the line {$level} around line 236
    under line AND post_date

  2. php global $ user_identity, $ user_level; get_currentuserinfo(); if ( $ user_identity) {
    if ($ user_level > = 8)

    doh that coding did not go thru..sorry..

    can i add a coding somewhere simialiar to check if the user level is this lower than 8.. show all cats except ID3 eg.
    AND { $ table_prefix }categories . cat_ID 3

    else show all cats

    thanks for your time

  3. Kim:

    “i want it to show call catgories.. bt if its lower that than i want certain post from catgories not to be displayed..”

    I really dont understand what you are saying here, but if you know what you want to display all you have to do is add lines of code to the SQL query, which will either display or not display what you want. The SQL query is between lines 369 and 378. If you can explain the above better you might be able to get better help.

  4. I have categories which are hidden to users of a certain level as well as no post access.. but with ur plugin it shows all posting no matter if its a locked out to user or not.

    This catgeories are not marked “private” and so if i use something like

    = 8) {

    i want it to show call catgories.. bt if its lower that than i want certain post from catgories not to be displayed..

    if that make sense.. its got nothign to do with private posting..

  5. Hi there,I was wondering if you can make this into a widget??? for i am using a widget theme and would like to see this in action.

    great work otherwise, but i cant use it til its a widget :/

  6. JH:

    I dont have the time right now to work on this. Maybe next week at best sometime next week. Click on my name to the left of this post. It will take you to my website and you can conact me from there. or email at (stoi2m1[at](yahoo(dot(com)));

  7. Hi, Jess I know this post isn’t appropriate here but I think it’s only you who could make the code for hiding the child category and an option in the admin panel for this plugin at http://dev.wp-plugins.org/file/front-page-cats/trunk/front_page_cats.php

    I’m sorry Admin, I asked it here. Thanks.

  8. Jesse:
    Thanks. You said,

    There are many other ways to add or remove categories. You could add some code to the plugin to list all of the cateogries on your options page and then by placing a check mark next to them, they will be displayed. However that is beyond the scope of this plugin, at this time, and would probably require you to add that feature on your own.

    May I know the code to add this feature in my admin panel? Thanks.

  9. Jesse: Nice work :)

  10. Gemme:

    You can limit which categories not to display if you know what the category id is.
    Use the following:
    -In the script, find this line (on or about line 233):
    AND post_status = ‘publish’
    -Right ABOVE it, add this line:
    AND {$table_prefix}categories.cat_ID 3
    (Where 3 is the category ID)
    The new line removes that category from the list, however you could change to = and it will only list that category. You can duplicate that line for all of the categories you wish to be displayed.

    There are many other ways to add or remove categories. You could add some code to the plugin to list all of the cateogries on your options page and then by placing a check mark next to them, they will be displayed. However that is beyond the scope of this plugin, at this time, and would probably require you to add that feature on your own.

    Kim:
    The option to hide password protected posts is already available, all you have to do is activate the plugin. Go to the options page of the admin panel click on a tab called DDLatestFromEach and place a check mark next to hide password protected posts.

    JH:
    You can hide child categories by:

    -In the script, find this line (on or about line 233):
    AND post_status = ‘publish’
    -Right ABOVE it, add this line:
    AND {$table_prefix}categories.category_parent = 0

    This tells the plugin to ignore sub categories or child categories.

    Also I do believe the elipse (…) has been added, but I there was an error in the code. On or about line 338, you will need to replace sizeof with strlen. About the word count vs. character count, thats a bit of code to be created. Im not sure we will see that feature.

  11. The child category shows up when parent category is included in the category to show. It would be better if Number of Words to show than Characters, and a [...] after that.

  12. Hi there. is there a way to hide a post UNLESS you have the right level to view it…??? i am looking for a post plugin that will do that.. and i am intersted in knowing/seeing if u can get that going…

  13. Excellent plugin. I’m already using it. One of the things that could be a great addition is the option to select which categories will be displayed.

  14. enrico: Any 2.x version should work fine. Is it just showing some of your posts? Or none at all? You might want to check the options to make sure it is set to show everything.

  15. 76
    enrico

    hi
    in wordpress 2.0.4 im finding some problems.. it does not display the post correctly.. it does not see them..

    do you know if 2.0.4 is critic for the plugin?

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