• I am trying to have the Widget on the side that displays the most recent posts also display the date that the posts were added. Maybe just the month and the day. Unfortunately, I am not a code wizard and have basic “skills” so I am looking into how to resolve this – if even possible. It doesn’t seem like it would be that complicated, but you never know.

    Thanks in advance for any help. The website is:

Viewing 3 replies - 1 through 3 (of 3 total)
  • It may be possible to do that using a filter. I’ll look into it.

    “It doesn’t seem like it would be that complicated …”

    Famous last words. ??

    Well, you are right, it shouldn’t have been that complicated. I looked at the default widget code, and I could see exactly where to make the change you requested. Unfortunately, there was no filter available at that spot, so I couldn’t change it using the normal plugin development methods.

    As a test, I hacked one of the WordPress core files and got it working in five minutes. But of course, hacking core files is not something you are ever supposed to do on a production installation.

    So … I decided to extract the relevant code from default-widgets.php and create a custom widget (I had been meaning to work through the process of creating a widget anyway). Here’s the download link; you’re welcome to try it if you want.

    https://www.ambrosite.com/download/recent-posts-dated-widget.zip

    Like all plugins, it needs to be uploaded to the /wp-content/plugins/ directory and activated through the Plugins menu in the admin panel. It creates a widget called Recent Posts Dated which you can use in place of the default Recent Posts widget. Let me know if this is what you wanted.

    Just what I was looking for – nice and simple, easy to modify, and works perfectly. Thanks for sharing!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding Date to Recent Posts Widget’ is closed to new replies.