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.4   Updated Sunday, February 22nd, 2009 at 8:20pm

This Day Plugin for WordPress

After every post, this plugin will list other posts on the same day from other years. Options include adjusting the number of posts to show, changing the sort order, the header text, hiding password protected posts, and more.

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 DDThisDay)
  • Test it out by viewing a post. Of course for it to display anything, there must be at least one other post with the same month and day as the one you are looking at

Change Log

  • 09-22-07 Version 1.4 – Option added to hide password protected posts (they were hidden by default before). Non-published posts no longer show up in the list. Added ‘Load Default Options’ button.
  • 05-16-07 Version 1.3 – Updated for WordPress 2.2
  • 04-07-07 Version 1.2 – Updated for WordPress 2.1
  • 01-02-07 Version 1.1 – Modified to only list posts
  • 04-04-06 Version 1.0 – First release

Notes

This plugin will not display anything (not even the specified header text) if there are no matching posts. So if it does not seem to be working, make sure you are viewing at a post that has other posts on the same day.

Options

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

Max posts to show

This allows you to set a limit on the number of posts that will be displayed. Set this to 0 for no limit.

Sorting

You can choose to list newest or oldest posts first.

Header text

This will be shown before the list of posts.

Show other posts from today

Enabling this will show other posts from the exact same date as the post being viewed (otherwise it will only check other years).

Show the year

If enabled, this will show the post year after each post in the list.

Hide password protected posts

If enabled, password protected posts will not show up in the list.

  1. We supply all kinds of moncler boots,moncler bags,moncler coats,moncler jackets,moncler T-shirt,moncler vest and so on.We have got a good reputation pf our products with top quality and good price.We sincerely look forward to futher cooperation with you for mutual benefits.We are sure that you will find working with us is a pleasant, time-saving and profitable experience. Please feel free to contact us if you have any questions.Our website is http://www.newlyapparel.com.

  2. Thanks for such a great plugin, I like Edian was also thinking of writing a plugin for this exact purpose but then I found yours. Also You should really put this on the wordpress plugin directory. :-)

  3. This plugin has been tested, and works, with the latest release of WordPress – 2.8

  4. This plugin has been tested in the latest release of WordPress (2.7.1)

  5. I just found this plug-in, I was thinking on doing it myself but first I did a google search and found you… again, I’m using your sitemaps plugin also, thanks man, :) Now if only you can do a plugin to stop time… ;)

  6. Great plugin, thanks for providing it. Would love to see if there’s some extras added to this over time, maybe the ability to look a few days either side of the post date for a post to display …. over my head to make that change so i’ll just have to wait, thanks again!

  7. 53
    shioiri

    Thank you.
    I have an idea for this plug-in.
    When I using MovableType,
    I used combi of MTOnThisDay and MTCollect.
    It solves to display the entry list with its img thumbnail.
    Do you solve this idea?

  8. i was wondering if this plugin is capable of displaying one post every day on the front page. like, every june 16th it will display the post from june 16th on the homepage without having to do anything. basically to have 365 posts that will rotate on the “home page”

  9. Version 1.4 has been released

    An option has been added to hide password protected posts (they were hidden by default before). Non-published posts no longer show up in the list. A ‘Load Default Options’ button has also been added to the options page.

    This latest version has been tested with WordPress 2.3, and will still work in previous versions as well.

  10. could you please add an option (or set it default) to list only “published” post ? It shows all posts currently, including draft …

  11. Dgold: It would be possible yes, with modifications.

  12. 48
    Dgold

    Hi! Thanks!

    Is it possible with this plugin, to show: not posts from the “exact” day of a previous year, but instead show the “most recent post to this day each year-previous”. In other words, the whole week 1 year ago, the whole week 2 years ago, ec.

    For example, today is May 22, 2007. I want to show posts from May 17-22, 2006+2005+2004+2003.

  13. Hi, just changed to use latest v1.2. I commented off line 222 add_filter(‘the_content’, ‘ddtd_generate’); to customize the position where DD-THIS-DAY shows posts. But the change breaks wordpress. When I activated the plugin, WordPress reported an error but the plugin was activated, but from now on my webpage layout was broken. It seems some extra char is inserted. Can you check this? Thanks.
    I’m using latest WordPress v2.1.3.

  14. ijliao: What version of WP are you using?

  15. but without status check, it will show my draft in the list

  16. ijliao: Because of the way the database was changed in WordPress 2.1 – I do not like it either ;) It makes it a hassle.

  17. why remove “post_status = ‘publish’” from your sql query ?

  18. Norm: This plugin lists the other posts on the same day as the current post. This is why it can only work on the single post page. It would not know what post to check for on the index, or archives, etc.. pages.

  19. the plugin works great but only seems to work on the posts permalink page, not on the main page of the blog. Is it supposed to work this way? Let me know if you have any ideas on how to fix this.
    Thanks!

  20. aha i have done it!

  21. hello,i like this plugin very much.
    but i have a question:
    how can i “Lists posts that were created on this day in previous years” in the sidebar of my single post?
    thank you very much!

  22. Bob: I believe this was due to database changes that were made to WordPress 2.1. I just updated the plugin and uploaded version 1.2, which should take care of the issue – let me know.

  23. I just ran across my first issue with this plugin. I normally add photographs to blog posts manually. Today, I used WP’s upload. When I did, This Day added a link to each of the photographs. I then deleted the uploads and added the photographs manually as I usually do.

    The links to the non-existing photographs, because I deleted them, are still there. How can I remove these?

  24. zhou: I certainly need to at least add them to this page – I just often forget, as I am constantly working on many different projects at once, in addition to keeping this site updated, as well as many others, etc.. Pretty soon I will probably go through all the script/plugin articles and add in extra info from the comments though :)

  25. [...] “Dagon Design – This Day“,汉化 以在每篇文章的下面显示”今天”我写的文章,范例 (2人) [...]

  26. 34
    zhou

    Aleister, I find some discussion in comments are very helpful such as how to use echo ddtd_show_posts(). Why not arrange them in a ReadMe? If I were a native English speaker I would do this. :-)

  27. [...] Dagon Design – This Day:显示历史上的今天,重温过去; [...]

  28. Dave: 1) That would be possible, but some code would have to be modified. Having it only display posts from a particular category would be the easiest to do.

    2) The current plugin will not really do that, because it generates its data when a post is being viewed. It would be possible to create a plugin (that displays in your sidebar for example), which lists previous posts from the current date (instead of the data of the post being viewed).

    If you are interested in having a custom version created to do either, please contact me :)

  29. My blog is interspersed with posts to memorialize events that happened on a certain day (in my case lost submarines). As the anniversary of each date I would like to display only these posts from previous years.

    Is there a way to:
    1. Display ONLY posts on “this day” that meet a certain criteria? (maybe a tag, or that fall within a category)
    2. Display posts from previous years even if there are no posts for today? (I saw a similiar question posed, but did not see an answer).

  30. 30
    John

    Thanks so much for this!

  31. [...] Dagon Design – This Day v1.1 [...]

  32. [...] Dagon Design – This Day: 「歷史上的今天」查看過往的今天寫了些什麼文章 [...]

  33. [...] Dagon Design – This Day,歷史上的今天。 :) Tag in: plugins word press歷史上的今天wordpress 換到 2.0 :) – 2006Share This You can leave a response, or trackback from your own site. [...]

  34. thanks a lot
    it does work
    hahahaaah
    thanks

  35. xhi: The options stored in the plugin file itself are just the defaults. They are used the first time you install the plugin. After that, they are not used anymore. You must configure everything in the options page this plugin creates in the admin panel (under Options).

  36. thanks for the awesome plugin.
    i have a little problem here,
    no matter how i change the words in the paragraph
    “add_option(‘ddtd_header’, ‘On this day’);”
    the head title doesn’t change.
    anybody get the same problem?
    how to solve it?
    thanks again.

  37. [...] This Day – show the related post that posted on the same day in the past [...]

  38. hit1205: Ah yes, I must have let that one slip past me ;) I will fix it next time I update this.

  39. I love this plugin very much !

    But maybe some people are same with me that don’t want to
    display the entries with “page” status under “On this day.”

    Could you replace

    AND post_status != 'draft' 
    AND post_status != 'attachment' 
    toAND post_status = 'publish'

    or let it to be a customize option? Thanks you very much :-)

    PS. I’m sorry for that I speak poor English

  40. Jon: Ah yes, I forgot to mention that part :) Glad it is working for you.

  41. Nevermind – it was as easy as commenting out /*add_filter('the_content', 'ddtd_generate');*/ at the end of the file. Thank!

  42. Thanks for the quick reply! That does work for sticking it in the sidebar. Now all I have to do is figure out how to suppress the display at the end of the post content. Any hints?

  43. Jon: Currently this plugin uses a wordpress filter to append the data to the content of the post. Now one thing you could try, is calling the main function (that generates the output) directly from the sidebar file, like this:

    <php echo ddtd_show_posts(); ?>

    This should work, but I have not tested it. :)

  44. This is an excellent way to highlight older content. I have a question though: is there an easy way to control where this plugin displays it’s output? I would like to have the output appear in a sidebar, as opposed to underneath the post.

  45. [...] Dagon Design – This Day: 「歷史上的今天」查看過往的今天寫了些什麼文章 [...]

  46. [...] 找了好久,終於找到這樣的 plugin 了。我是在 Dagon Design 看到的,plugin 名稱叫「This Day」,安裝方法超簡單的。 [...]

  47. Suppose I have 366 posts on every single day of 2005 year but no post of 2006. I want to show “on this day’s” post of the past year on the home page. For example, today is Oct 01 and I have no post of Oct 01, 2006, but my home page will show the post of Oct 01, 2005. Is that possible?
    Thank You.

  48. thanks

  49. sindhu: Can you email me the contents of your sitebar file? You were not really rude, it just sounded demanding :P

  50. when the write the php code enclosed within the div box int he sidebar….its says something like this “/homepages/13/d164545791/htdocs/synful/wp-content/themes/hyperballad/sidebar.php on line 85″ ???? am confused.

  51. ask nicely? i think i did. if i was rude, i dont understand where though….:( well i apologise

  52. sindhu: You could have asked nicely :P Try this:

    <?php ddtd_show_posts(); ?>

  53. something like maybe i guess

    help me out!

  54. hey there, need help very quickly, i use The hyperballad theme. uhm ur plugin isnt showing up in action in my blog, ive installed everything as sed…uhm can tell me the code like that to manually place the dis day las month plugin in my side bar ???

  55. thanks for the tip

  56. nchenga: Yes, this is intentional. If you want to change it, find this line in the plugin:

    if (is_single()) {

    And change it to this:

    if (is_single() || is_home()) {

  57. the links only show up when I view the posting. They do not display in the posting on the main page.

    i.e. http://www.chiperoni.org/wordpress/archives/2006/06/24/bike-tours/ vs http://www.chiperoni.org/wordpress/

    Is this intended?

    regards,
    nchenga

  58. Thanks :) Glad you like it. I also noticed that you posted some nice comments on some of the other articles. Always nice to see happy users :)

  59. This is a great idea, and it promotes older blog posts – useful for me as I lost access to my Haloscan and Blogger comments when I moved to using WordPress on my own domain in January 2006. As I’d maintained my blog going back to August 2004, I was peeved to lose access to the many comments folks had left but I was at least able to import the majority of my Blogger posts themselves into WordPress, and figured I could live with the loss of old comments given the many advantages of switching to WordPress. Still, this plugin now means my older posts can get some exposure to the light once again! Hopefully they might get new comments, or at least they stand more chance of being read – which is, after all, the reason most of us blog, to see our stuff get out there and find a readership! Thank you again. Your plugins are marvellous. I really do wish all plugin developers would take their lead from you in terms of clear instructions and well-crafted PHP code.

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.