“Who ya gonna call?” “CODEBUSTERS”
No.
But the metaphor of Ghostbusters crossing the streams was inversely appropriate to a little bit of code action over the holidays (of which the actual action was nil).
But this was fun.
This nice tweet from John Johnston (who spawned the idea) reminded me of a WordPress plugin I had made
The WP Posted Today plugin is meant to offer a short code you can put on a site and it will list all previous posts on the current calendar day (this of course is useful if you actually still blog regularly) (cough) (cough).
Just for grins I checked the page where I use my own plugin. Yikes. Red Alert. It displayed all the ones for December 29 in years past, but the part where it should list how many there were was blank.
I dug into my own code… and found myself a bit lost. Crossed. I was not even sure where I got the sprintf functions (John’s original code?) that were aimed to be compatible if anyone every wanted a language translation (maybe, or it’s just that thing when people code things differently).
Taking the path of least resistance, I took out the code where I think the problem was occurring and did it a more simple, but brute force way.
And it worked.
So I updated the version on GitHub and felt at peace with the world. In the off chance someone stumbled into my little corner of code, they would find something that works (or should work).
And then (here comes a stream crossing) Michael Hanscom @djwudi — someone I don’t think I’ve ever communicated with — tweets that he had seen pretty much the same bug and offered a fix.
In looking at his post I saw the fix he made, and said– that’s better than mine! So I decided today to roll back my changes in place of Michael’s solution (but also keeping a modification I had made to remove extraneous calls when not needed for singular versus multiple results).
I noted the extra change he made in hos own version
Plus, I’ve made one other tweak to the plugin, so that it adds a link to the end of the excerpt to better handle “microblog” style entries that don’t have titles, so I still get to feel good about that part, as well. 🙂 My coding skills may be underdeveloped and rusty from lack of regular use, but they’re not entirely atrophied!
In this case, these microblog type entries (see Michael’s demo page) lack titles, so yes, a link is needed at the end of the post excerpt.
Yet I could see that regular posts (like on my site) did not need the extra link, and also, not everyone might want the arrow Michael likes.
I solved this cleverly by creating an additional shortcode parameter more which defaults to a blank string. In the shortcode function, we convert any attributes passed to variables with
extract(shortcode_atts( array( "month" => '', "day" => '', 'excerpt' => 1, 'more' => '' ), $atts ));
So on my site, where I just used the shortcode There are 10 posts previously published on December 31st
- 2023
- Hopetimism Tick, tick, tick, hours before the Y in date functions goes up by one. There are no year end summaries here, no glorifying the air miles clocked (not many anyhow), no forecasts for 2024, and FFS absolutely no resolutions. The week of time away held promise for catching up on writing here, where the drafts […]
- 2016
- 2016 Flickring By Too Just one more under the wire blog post for 2017, and yes it’s about photos. I had to wait until I posted photo number 366 for this year… … so I could try John Johnston’s “wee little” script he posted that generates a rapid montage of a series of flickr photos. There was a now […]
- Through the Lens I See, Be Michael Coghlan is one of those people I have known so long online that I forgot how/where we met. We have spent time together in his home of Adelaide, Australia. When? What were we doing? The memory is fuzzy, but I can get the info because I have photos of that time. It was October […]
- 2014
- Don’t Stop the FedWiki Party If you thought Mike Caulfield was excited for months about Smallest Federated Wiki, you should read what he thinks after bring a great group of folks to his FedWikiHappening… over the Christmas holiday. And while my Kool-Aid consumption is at a positively high level, I am not quite there to Mike’s. But as they overly […]
- 363 out of 365 for 2014 I’m planning on skipping the philosophical life’s been good to me so far year end posts, but cannot pass up on my most regular activity since 2008- my daily photo (almost every day) post to flickr. You can get the back story in previous posts, but more or less, after seeing D’Arcy Norman do it […]
- 2012
- The Strawberry Snow Monster LIVES! GIFs! The Abominable Pine Man was spotted in the vicinity on December 15, 2012. Unlike the Lock news Monster, Sasquatch, the photos of this super natural creature ares sharp, clean, and obvious no fabrication or some buffoon in a fur suit. cc licensed ( BY ) flickr photo shared by cogdogblog In time the monster morphed […]
- Flickr App: Going Beyond Filters and Likes cc licensed ( BY NC ) flickr photo shared by larskflem Has the [quasi] exodus from Instagram to flickr already faded? After what future students of business may use in a case study of corporate idiocracy over their not so friendly terms of service. Reports suggested Instagram lost 25% of their users, but as noted […]
- 2010
- Just a Quiet End of 2010 Oh yawn, its that time of year when people start reflecting on their belly button lint and drawing out their highlights of 2010. Fair enough, it’s a worthy practice, but quite often, to me, it ends up feeling like reading those 3 page holiday letters from Aunt Edna (who you barely know) and her 13 […]
- 2008
- Last Day Last Photo (366 later) Today’s photo was just another day, just another photo, a string of 366 of them since Mike the Lllama on Jan 1 , 2008 when D’Arcy Norman prompted me to follow along with the post a photo a day game (see more back story in One Day One Photo where this all started). At last […]
- 2003
- Now X-Serving for 2004… Jade Has Moved No addresses or URLs have been shuffled, but today I finally managed to move our ‘Jade’ server (if anyone has caught notice, all machines in my area are domain named after minerals… my G4 laptop is ‘Topaz’, my beige PC is “Pyrite’, there is an old Mac named ‘Sphalerite’ acting as a mulit-user server for […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 10 posts previously published on December 31st
- 2023
- Hopetimism Tick, tick, tick, hours before the Y in date functions goes up by one. There are no year end summaries here, no glorifying the air miles clocked (not many anyhow), no forecasts for 2024, and FFS absolutely no resolutions. The week of time away held promise for catching up on writing here, where the drafts […] ➡
- 2016
- 2016 Flickring By Too Just one more under the wire blog post for 2017, and yes it’s about photos. I had to wait until I posted photo number 366 for this year… … so I could try John Johnston’s “wee little” script he posted that generates a rapid montage of a series of flickr photos. There was a now […] ➡
- Through the Lens I See, Be Michael Coghlan is one of those people I have known so long online that I forgot how/where we met. We have spent time together in his home of Adelaide, Australia. When? What were we doing? The memory is fuzzy, but I can get the info because I have photos of that time. It was October […] ➡
- 2014
- Don’t Stop the FedWiki Party If you thought Mike Caulfield was excited for months about Smallest Federated Wiki, you should read what he thinks after bring a great group of folks to his FedWikiHappening… over the Christmas holiday. And while my Kool-Aid consumption is at a positively high level, I am not quite there to Mike’s. But as they overly […] ➡
- 363 out of 365 for 2014 I’m planning on skipping the philosophical life’s been good to me so far year end posts, but cannot pass up on my most regular activity since 2008- my daily photo (almost every day) post to flickr. You can get the back story in previous posts, but more or less, after seeing D’Arcy Norman do it […] ➡
- 2012
- The Strawberry Snow Monster LIVES! GIFs! The Abominable Pine Man was spotted in the vicinity on December 15, 2012. Unlike the Lock news Monster, Sasquatch, the photos of this super natural creature ares sharp, clean, and obvious no fabrication or some buffoon in a fur suit. cc licensed ( BY ) flickr photo shared by cogdogblog In time the monster morphed […] ➡
- Flickr App: Going Beyond Filters and Likes cc licensed ( BY NC ) flickr photo shared by larskflem Has the [quasi] exodus from Instagram to flickr already faded? After what future students of business may use in a case study of corporate idiocracy over their not so friendly terms of service. Reports suggested Instagram lost 25% of their users, but as noted […] ➡
- 2010
- Just a Quiet End of 2010 Oh yawn, its that time of year when people start reflecting on their belly button lint and drawing out their highlights of 2010. Fair enough, it’s a worthy practice, but quite often, to me, it ends up feeling like reading those 3 page holiday letters from Aunt Edna (who you barely know) and her 13 […] ➡
- 2008
- Last Day Last Photo (366 later) Today’s photo was just another day, just another photo, a string of 366 of them since Mike the Lllama on Jan 1 , 2008 when D’Arcy Norman prompted me to follow along with the post a photo a day game (see more back story in One Day One Photo where this all started). At last […] ➡
- 2003
- Now X-Serving for 2004… Jade Has Moved No addresses or URLs have been shuffled, but today I finally managed to move our ‘Jade’ server (if anyone has caught notice, all machines in my area are domain named after minerals… my G4 laptop is ‘Topaz’, my beige PC is “Pyrite’, there is an old Mac named ‘Sphalerite’ acting as a mulit-user server for […] ➡
to get the arrow codes he likes. This works because output for each found post looks like
// output post and link
$output .= '
' . get_the_title() . '';
// display excerpt if we want it
if ( $excerpt ) $output .= ' ' . get_the_excerpt();
// for microblog output where there might not be titles so add a link at end
// h/t https://www.michaelhanscom.com/eclecticism/2020/01/02/rss-feed-weirdness-and-php-debugging/
$output .= ' ' . $more . '';
So how is that for the odds of streams crossing on the same obscure bit of code? That’s the old fashioned kind of net serendipity that still happens.
Thanks Michael! Check out his 20 year old blog, he’s an “Enthusiastically Ambiverted Hopepunk” quite the tag line.
Featured Image: Edit of the Ghostbusters Cross Streams scene found in the Ghostbusters Fandom Wiki site which states “Community content is available under CC-BY-SA unless otherwise noted.” I replaced part of the background with a screenshot of the WP Posted Today PHP code.