Weekday plugin
Well … it looks like I’ve created another plugin today. I’m on a roll …
Anyways, this one is a plugin that will add the weekday next to the date …
- If the post was posted today, it will put “Today”.
- If the post was posted yesterday, it will put “Yesterday”.
- Otherwise it will put the actual weekday (i.e. Tuesday).
I had done this in MT and wanted to use it here too. Took a little more finagling than it did in MT because of the way that WP does the date. But it’s done. If you’d like to do this on your blog too, you can get the plugin here.
And to use this, replace …
<?php the_date(); ?>
with …
<?php weekday_date(); ?>
I’ve only got posts from today in my blog so far, so I can’t test this beyond that. So … if you have any problems or questions, please let me know.
Last Updated on: 23 Jun 04 at 12:56pm
Plugin file: weekday.php
Other needed files: none
:: EDIT - 23 Jun 04 9:15am :: There appears to be an issue with this plugin. It doesn’t display “Yesterday” like it is supposed to. I will work on it and post the updated code.
:: EDIT - 23 Jun 04 9:25am :: Took me only 10 minutes to figure out that one (actually less ‘cuz I fixed some other stuff). I’ve updated the code and it should work now.
:: EDIT - 23 Jun 04 12:24pm :: Looks like another issue has cropped up with this plugin. I’ve got it working correctly for “Today” and “Yesterday”, but other than that, it’s just putting either “Wednesday” or “Thursday”. I will be working on it this afternoon to resolve this issue. Please be patient with me. This is one of my first attempts at a plugin. I never said it was fool proof.
:: EDIT - 23 Jun 04 12:56pm :: Okay I think I have things working now. I was thinking too hard trying to fix it. The solution was easier than I thought. The plugin has been updated. Download and try the new code and let me know if it works.
working
accomplished