Follow Me on Twitter!

Last Update: 3 February 2007

Plugin Name: Previous Posts
Version: 1.2
Plugin URI: http://www.cypherhackz.net/plugins-themes/previous-posts/
Description: Returns a list of your previous posts. You can set how many posts to be displayed.
Author: Fauzi Mohd Darus
Author URI: http://www.cypherhackz.net/

Demo:

Download:

How to Install

  1. Download the plugin file.
  2. Extract file cypher_previous-posts.zip.
  3. Upload wp-previousposts.php to your Wordpress plugin folder.
  4. Activate the plugin in your Plugins admin panel.
  5. Put this function <?php cypher_previousposts(); ?> in your theme file.
  6. Done!

How to Upgrade

  1. Download the plugin file.
  2. Extract file cypher_previous-posts.zip.
  3. Upload wp-previousposts.php to your Wordpress plugin folder to replace the previous version plugin.
  4. Done!

Parameters
There are two parameters that you can use to change the behavior of this plugin.

$min – The minimum number of posts to count. Default is 10;
$max – The maximum number of posts to count. Default is 15;

Eg: <?php cypher_previousposts(5,15); ?>
- This means that posts between 5 and 15 will be displayed on the list.

Version History

  • 1.2
    - Compatible with Wordpress 2.1
    - Update the parameters
  • 1.1
    - Include permalinks instead of using Wordpress post IDs
  • 1.0
    - Initial Release

45 Responses to “WP Plugin: Previous Posts”

  1. nathan
    February 28th, 2007 | 1:35 am | Reply

    Any chance you would know how I could integrate the_content into this as well?

  2. CypherHackz
    February 28th, 2007 | 2:11 pm | Reply

    if you want to do that, you need to edit my plugin. my plugin only displays the titles.

  3. nathan
    February 28th, 2007 | 11:26 pm | Reply

    Thanks for the reply. I figured there would be some plugin editing, but I’m not sure… I tried doing something like this:

    if($posts){
    foreach ($posts as $post){
    $post_title = stripslashes($post->post_title);
    $post_link = stripslashes($post->ID);
    $post_date = stripslashes($post->post_date);
    $post_content = stripslashes($post->the_content);

    //$output .= $before . $post_date . $after;
    $output .= $before . '' . $post_title . '' . $post_content ;
    $output .= $after;
    }

    But to no avail… do you know what I might be able to replace “the_content” with?

  4. nathan
    February 28th, 2007 | 11:28 pm | Reply

    I just tried posting a reply with what I tried but I’m not sure how to add PHP to the comments form – looks like it just swallowed my comment.

    I tried editing your plugin by adding something like

    $post_content = stripslashes($post->the_content);

    and then adding $post_content to the $output but to no avail.

    Any chance you’d know what I’d need to plug in for “the_content”?

    Thanks so much for the reply!

  5. Joao
    March 3rd, 2007 | 2:06 pm | Reply

    Hi there,

    is there a way to show the latest articles on a specific cartegory?

  6. CypherHackz
    March 5th, 2007 | 8:40 am | Reply

    [Comment ID #25044 Will Be Quoted Here]

    i will see what i can do for you. currently i’m busy with my study. maybe i will included it in next version. :d

    [Comment ID #25715 Will Be Quoted Here]

    perhaps there is a plugin could do that. try looking at the wpplugin website. :)

  7. Hisham
    March 17th, 2007 | 12:04 am | Reply

    Thanks Fauzi! I was looking for this, since wp_get_posts does not have an offset parameter!

  8. Lynn
    May 18th, 2007 | 6:06 am | Reply

    You wrote that one should put in the theme file. WHICH theme file?

    You wrote
    “There are two parameters that you can use to change the behavior of this plugin.

    $min – The minimum number of posts to count. Default is 10;
    $max – The maximum number of posts to count. Default is 15;”

    WHERE? Can this be accomplished by just using parameters in
    ? or do I have to edit wp-previousposts.php?

    Thanks.

  9. Lynn
    May 18th, 2007 | 6:11 am | Reply

    You wrote: add to them file. Which (of many) theme file?

  10. CypherHackz
    May 18th, 2007 | 9:55 am | Reply

    owh…put the tag in your index.php or in sidebar.php. save and upload to your server. ;)

  11. alex
    May 20th, 2007 | 12:00 am | Reply

    thanks for the great plugin. Simple, but it does want I need.

  12. CypherHackz
    May 20th, 2007 | 12:42 pm | Reply

    you are welcome. :d

  13. ash
    July 24th, 2007 | 8:16 am | Reply

    hi there,
    there’s a little flaw in line 32:

    if($bil > $min && $bil

    should be


    if ($bil >= $min && $bil

    otherwise the most recent post doesn't show for $min=1 :).

    but fixing that was easier than writing it all by myself, so thank you very much for that plugin :).

  14. Stacy
    November 9th, 2007 | 1:30 am | Reply

    Thanks for the plugin, it is very cool.  Is there a way to put a space between the article names? I am new to php. Thanks

  15. CypherHackz
    November 9th, 2007 | 7:31 am | Reply

    Open the plugin file, in line 14 and 15, you can set your own method on how the plugin will display the article title. The default is <li> </li>. But you can change to <br /> or something else.

  16. Samer Kurdi
    November 30th, 2007 | 7:00 am | Reply

    Thanks for a great plugin.
    Is there a way to not have the post names descend on the next line if the name is too big (perhaps just have a … at the end instead?).

  17. CypherHackz
    November 30th, 2007 | 8:45 am | Reply

    Right now this plugin will not truncate long title. But I will inlcude it in next version. Thanks. :)

  18. MikeonTV
    February 14th, 2008 | 9:05 pm | Reply

    How come I cannot display more than one of the most previous posts? Thats odd. Hard to enjoy the plugin if you ask me

  19. nathan
    February 14th, 2008 | 9:47 pm | Reply

    You’d think a little gratitude was in order for anything that comes free with WordPress, if you can’t enjoy the plugin, frankly, no one cares.

    Please people, remember that these guys are writing and sharing these plugins out of the goodness of their hearts; showing that you’re appreciative is more likely to keep it this way than sarcastic scoffing.

  20. bob
    March 28th, 2008 | 1:29 am | Reply

    H1MSam hi super site thanks http://peace.com

  21. Search
    April 25th, 2008 | 6:52 am | Reply

    this is what ive been looking for

  22. Home
    April 26th, 2008 | 2:42 am | Reply

    this is useful, cetainly gonna try this out.

  23. Estate
    June 11th, 2008 | 5:19 am | Reply

    good article, its too hot to type more

  24. legal
    June 18th, 2008 | 11:58 pm | Reply

    excellent a++

  25. Москва
    August 5th, 2008 | 10:14 pm | Reply

    Аудит основных средств и организация аудита и аудит операций и задачи аудита и аудит операций и аудит операций AAR Group

  26. Москва
    August 7th, 2008 | 5:18 pm | Reply

    Аудит операций и задачи аудита и основы аудита, а также основы аудита, основной аудит, аудиторская компания AAR Group

  27. Москва
    September 4th, 2008 | 11:11 pm | Reply

    AAR Group предлагает проведения инвентаризации материальных ценностей, а также проведение регулярных инвентаризаций

  28. Ford chips
    September 26th, 2008 | 10:35 pm | Reply

    Very vary interesting plugin.

  29. SMS Alerts
    October 4th, 2008 | 2:56 am | Reply

    Yes, seen this plugin before and read a little about it. But i think i might now give it a try.
    Thanks for the share!

  30. emo
    October 11th, 2008 | 9:28 pm | Reply

    Good short sweet turorial.

  31. Domain
    October 12th, 2008 | 1:31 pm | Reply

    thanks for sharing this useful plugin, keep up the good job!

  32. Golfmitgliedschaft
    October 12th, 2008 | 2:35 pm | Reply

    thanks for the great plugin. Simple, but it does want I need.

  33. Москва
    November 20th, 2008 | 12:37 am | Reply

    Средства аудита, экзамен аудитора и методика аудита, а также аудит и виды аудита, подготовка аудиторов, финансовый аудит

  34. Москва
    January 11th, 2009 | 8:55 am | Reply

    Спутниковая интерактивная карта Кисловодска и другое на MapSpace.Ru

  35. кaпpиз
    June 13th, 2009 | 6:04 pm | Reply

    Дискутировать можно бесконечно, поэтому просто поблагодарю автора. Спасибо вам!

  36. Rumait
    August 2nd, 2009 | 4:45 pm | Reply

    Nice Plugin, It will increase our page views

  37. +18 oyunlar
    October 4th, 2009 | 6:31 am | Reply

    nice plugin thanks for sharin

Leave a Reply