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

Red arrow points to missing number where the page output reads "There are posts previously published on December 29th"

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.

https://twitter.com/djwudi/status/1212871226953101313

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 22 posts previously published on January 4th

  • 2024
    • A Story of the Human Side of CC Licenses As we careen down the hill of inevitable slope to a machine generated future, it’s relieving to have small experiences that reveal humanness. Here’s one. In the world of Creative Common Licenses (which I am a BF, Big Fan), one of the least favorite things I see are nitpicking/haggling over license details, like they are […]
    • Tiny Tools for WordPress: Remove Comment Form on Media Attachments In the best Tom Woodward style1, this post is more a reference for me than most anyone else. Besides so many people are freaked out by the WordPress editor, who’s really gonna tweak a theme file? Me. Okay, I have a really old site that was part of the Networked Narratives fleet of sites (it’s […]
  • 2023
    • In the Cloud and on the Group Cover and not Down the Drain The unexpected responses to online activity, sharing openly, are the things that sparks my optimism the most. This most recently happened through a flickr email notification: Hi ! Congrats! The photo 2022/365/226 In the Cloud (*that* kind of cloud) you added to the group CSSS: Canada’s Thunderstorms has been selected to be its cover photo. […]
  • 2021
    • Public Domain as the Opener of Glorious Rabbit Holes January 1 was not only the day that relieved us of 2020, but also a celebration of works entering the Public Domain so works published in 1925 are finally available to all (celebrating that it takes 95 freaking Sonny Bono years to make this happen is bittersweet). I have a several times a day ceremony […]
  • 2020
    • Ok to Cross the Streams When Code Fixing “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 […]
  • 2019
    • Free (as in discard at will) Advice for #PressEdConf Last March I was fortunate to have participated in the uniquely formatted PressEd Conference. Unique it was because there was no air travel, no hotels, no rows of chairs under fluorescent lighting, no parachute presenting keynotes, no conference chicken, no droning powerpoint. That’s because the WordPress and Education, Pedagogy and Research conference was all done […]
  • 2018
    • WordPress End Around For Bad Playing Plugins Sometimes you choose a member for the front line of your WordPress site that just ends up not playing well. As alluded to in Swapping Out Sputtering SPLOT Plugins a plugin I suggested for the two calling card themes I developed this year, WP-Dimension and WP-Big Picture turned out to be a bad player. I […]
  • 2016
    • I Love The West First of all there’s the hats. Then it’s sitting around with a buddy talking about photos. And then heck, we might just go riding off into the sunset. I can’t wait for western106.
    • “Nobody” in the Spaghetti Today’s DS106 / Western Daily Create was to do some “research” on spaghetti westerns: #ds106 #dailycreate #tdc1457 Do Some Research on Spaghetti Westerns https://t.co/gBrUaW1JEf pic.twitter.com/aRXEhV6eMI — ds106 Daily Create (@ds106dc) January 4, 2016 This is one of those tasks that could be as simple as tweeting a link like Paul Bond’s refernece to a Mario […]
  • 2015
    • Red Boat Afloat Photos taken on January 1 are important to me as they are the start of a new daily photo set/album on flickr, a practice I have done every year back TO 2008. For this first day of the new year I traveled from Vancouver to Victoria via BC Ferries. It was the fourth in a […]
  • 2013
    • Generating an HDR Image from One Photo I’m sure someone who knows more about HDR or High Dynamic Range will shoot my stuff down, but I ran a fun photo experiment today (FWIW probably the best HDR tutorial is from Stuck in Customs). Basically it is a way to enhance photos that have a rane of dark and light values that are […]
    • Driving Off the Edge If you engage in daily or at least regular bouts of photography, it can be easier to find interesting topics when traveling as you are constantly being bombarded with new visuals. But back at home, you may have to get inventive to find interesting subjects. I’m starting in my sixth year of doing a daily […]
    • My World Caught in a Drop of Water Some of my favorite photos are ones that do not reveal themselves until I look at them on my computer, and see something I perhaps did not visualize when I took the photograph. I find the process of cropping my photos to be often one of those magical acts of creation by deletion. In this […]
  • 2012
    • Unlikely Intersections Doing daily photography makes me take note of many more details around me than I did before. I read a lot of signs, and thought over the last few months that it is interesting to find at intersections road signs for names or things that you would not expect to be crossing. Witness the Queen […]
    • Bleeding/Leading… cc licensed ( BY NC ND ) flickr photo shared by famousright Do you know the old saying “If it doesn’t bleed, it doesn’t lead…’ Do you? Because I could not find it attributed to anyone beyond “old media hands” or “old saying” or “as te saying goes”. Nevertheless, do not let the story get […]
  • 2009
  • 2008
    • Forget the Social Graph, Here’s the Twitter Graph! Forget the Social Graph, Here’s the Twitter Graph! posted 4 Jan ’08, 11.15pm MST PST on flickr Hardly a day passes now that there is not some other new web tool doing something interesting with data grabbed from twitter’s open APIs. This just in is Twitter Stats, which helps you analyze your (or someone else’s) […]
  • 2006
    • Englaze Flickr Backup Just randomly clicking the new feature links at the bottom of my flickr collection brought me to something I should get around top doing- getting a backup. Hey, what if Yahoo falls into the ocean? Englaze Archive will create a data DVD backup of your original flickr photos, the original uploaded sizes, and preserve titles […]
  • 2005
    • How Refreshing… Anders is GIVING money (to Tsunami Victims) For Blogging Anders is doing something link worthy- offering to dotate $1 for every blogger who posts a list of relief agencies and posts it on a public blog. That’s right, just post some links and/or make your own dontation, blog about it, and he chips in to the relief fund. I’d already Amazon-ed a contribution last […]
    • Writing Teachers Describe Blogging Yes, the blog bubble is mushrooming. Soon we may see less quizzical looks generated by the word. (remember when you had to explain what a mouse was or what a URL really provided?). I just skimmed some nice perspectives on blogs ppublished in LORE: An E-Journal for Teachers of Writing. The Digressions section features the […]
    • And Perspective on Bandwidth… Roll back your time clock to the mid 1990s and consider your reaction to this statement (lifted out of context from a comment about BitTorrent): Yesterday, it took me 2.5 hours to download a measly 39 megs. I remember being hesitant to download something as large as 5 Mb (even on the LAN at work), […]
    • Morning Perspective With access to newspapers and highspeed net access after a week away, the graphic imagery and harsh realities of the post-tsumani impacts make anything complained about here last night seem infinitesimally insignificant. Like others, I have been contacting friends and colleagues with families in Sri Lanka, India, and Thailand, and fortunately for them, their losses […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 22 posts previously published on January 4th

  • 2024
    • A Story of the Human Side of CC Licenses As we careen down the hill of inevitable slope to a machine generated future, it’s relieving to have small experiences that reveal humanness. Here’s one. In the world of Creative Common Licenses (which I am a BF, Big Fan), one of the least favorite things I see are nitpicking/haggling over license details, like they are […] &amp#x27A1;
    • Tiny Tools for WordPress: Remove Comment Form on Media Attachments In the best Tom Woodward style1, this post is more a reference for me than most anyone else. Besides so many people are freaked out by the WordPress editor, who’s really gonna tweak a theme file? Me. Okay, I have a really old site that was part of the Networked Narratives fleet of sites (it’s […] &amp#x27A1;
  • 2023
    • In the Cloud and on the Group Cover and not Down the Drain The unexpected responses to online activity, sharing openly, are the things that sparks my optimism the most. This most recently happened through a flickr email notification: Hi ! Congrats! The photo 2022/365/226 In the Cloud (*that* kind of cloud) you added to the group CSSS: Canada’s Thunderstorms has been selected to be its cover photo. […] &amp#x27A1;
  • 2021
    • Public Domain as the Opener of Glorious Rabbit Holes January 1 was not only the day that relieved us of 2020, but also a celebration of works entering the Public Domain so works published in 1925 are finally available to all (celebrating that it takes 95 freaking Sonny Bono years to make this happen is bittersweet). I have a several times a day ceremony […] &amp#x27A1;
  • 2020
    • Ok to Cross the Streams When Code Fixing “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 […] &amp#x27A1;
  • 2019
    • Free (as in discard at will) Advice for #PressEdConf Last March I was fortunate to have participated in the uniquely formatted PressEd Conference. Unique it was because there was no air travel, no hotels, no rows of chairs under fluorescent lighting, no parachute presenting keynotes, no conference chicken, no droning powerpoint. That’s because the WordPress and Education, Pedagogy and Research conference was all done […] &amp#x27A1;
  • 2018
    • WordPress End Around For Bad Playing Plugins Sometimes you choose a member for the front line of your WordPress site that just ends up not playing well. As alluded to in Swapping Out Sputtering SPLOT Plugins a plugin I suggested for the two calling card themes I developed this year, WP-Dimension and WP-Big Picture turned out to be a bad player. I […] &amp#x27A1;
  • 2016
    • I Love The West First of all there’s the hats. Then it’s sitting around with a buddy talking about photos. And then heck, we might just go riding off into the sunset. I can’t wait for western106. &amp#x27A1;
    • “Nobody” in the Spaghetti Today’s DS106 / Western Daily Create was to do some “research” on spaghetti westerns: #ds106 #dailycreate #tdc1457 Do Some Research on Spaghetti Westerns https://t.co/gBrUaW1JEf pic.twitter.com/aRXEhV6eMI — ds106 Daily Create (@ds106dc) January 4, 2016 This is one of those tasks that could be as simple as tweeting a link like Paul Bond’s refernece to a Mario […] &amp#x27A1;
  • 2015
    • Red Boat Afloat Photos taken on January 1 are important to me as they are the start of a new daily photo set/album on flickr, a practice I have done every year back TO 2008. For this first day of the new year I traveled from Vancouver to Victoria via BC Ferries. It was the fourth in a […] &amp#x27A1;
  • 2013
    • Generating an HDR Image from One Photo I’m sure someone who knows more about HDR or High Dynamic Range will shoot my stuff down, but I ran a fun photo experiment today (FWIW probably the best HDR tutorial is from Stuck in Customs). Basically it is a way to enhance photos that have a rane of dark and light values that are […] &amp#x27A1;
    • Driving Off the Edge If you engage in daily or at least regular bouts of photography, it can be easier to find interesting topics when traveling as you are constantly being bombarded with new visuals. But back at home, you may have to get inventive to find interesting subjects. I’m starting in my sixth year of doing a daily […] &amp#x27A1;
    • My World Caught in a Drop of Water Some of my favorite photos are ones that do not reveal themselves until I look at them on my computer, and see something I perhaps did not visualize when I took the photograph. I find the process of cropping my photos to be often one of those magical acts of creation by deletion. In this […] &amp#x27A1;
  • 2012
    • Unlikely Intersections Doing daily photography makes me take note of many more details around me than I did before. I read a lot of signs, and thought over the last few months that it is interesting to find at intersections road signs for names or things that you would not expect to be crossing. Witness the Queen […] &amp#x27A1;
    • Bleeding/Leading… cc licensed ( BY NC ND ) flickr photo shared by famousright Do you know the old saying “If it doesn’t bleed, it doesn’t lead…’ Do you? Because I could not find it attributed to anyone beyond “old media hands” or “old saying” or “as te saying goes”. Nevertheless, do not let the story get […] &amp#x27A1;
  • 2009
  • 2008
    • Forget the Social Graph, Here’s the Twitter Graph! Forget the Social Graph, Here’s the Twitter Graph! posted 4 Jan ’08, 11.15pm MST PST on flickr Hardly a day passes now that there is not some other new web tool doing something interesting with data grabbed from twitter’s open APIs. This just in is Twitter Stats, which helps you analyze your (or someone else’s) […] &amp#x27A1;
  • 2006
    • Englaze Flickr Backup Just randomly clicking the new feature links at the bottom of my flickr collection brought me to something I should get around top doing- getting a backup. Hey, what if Yahoo falls into the ocean? Englaze Archive will create a data DVD backup of your original flickr photos, the original uploaded sizes, and preserve titles […] &amp#x27A1;
  • 2005
    • How Refreshing… Anders is GIVING money (to Tsunami Victims) For Blogging Anders is doing something link worthy- offering to dotate $1 for every blogger who posts a list of relief agencies and posts it on a public blog. That’s right, just post some links and/or make your own dontation, blog about it, and he chips in to the relief fund. I’d already Amazon-ed a contribution last […] &amp#x27A1;
    • Writing Teachers Describe Blogging Yes, the blog bubble is mushrooming. Soon we may see less quizzical looks generated by the word. (remember when you had to explain what a mouse was or what a URL really provided?). I just skimmed some nice perspectives on blogs ppublished in LORE: An E-Journal for Teachers of Writing. The Digressions section features the […] &amp#x27A1;
    • And Perspective on Bandwidth… Roll back your time clock to the mid 1990s and consider your reaction to this statement (lifted out of context from a comment about BitTorrent): Yesterday, it took me 2.5 hours to download a measly 39 megs. I remember being hesitant to download something as large as 5 Mb (even on the LAN at work), […] &amp#x27A1;
    • Morning Perspective With access to newspapers and highspeed net access after a week away, the graphic imagery and harsh realities of the post-tsumani impacts make anything complained about here last night seem infinitesimally insignificant. Like others, I have been contacting friends and colleagues with families in Sri Lanka, India, and Thailand, and fortunately for them, their losses […] &amp#x27A1;
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.

    If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
    Become a patron at Patreon!
    Profile Picture for CogDog The Blog
    An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

    Leave a Reply

    Your email address will not be published. Required fields are marked *