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.

Pages: « 4 3 [2] 1 » Show All

  1. 30
    John

    Thanks so much for this!

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

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

  4. [...] 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. [...]

  5. thanks a lot
    it does work
    hahahaaah
    thanks

  6. 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).

  7. 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.

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

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

  10. 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

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

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

  13. 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?

  14. 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. :)

  15. 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.

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