“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 14 posts previously published on March 4th

  • 2025
    • This is a Test This is a post of the CogDogBlog Federated Publishing System. This is only a test. Nah, it;s a real blog post! But my last post was not published to the Fediverse and the kind folks who make the software and actually respond like humans suggested the newest version of the ActivityPub plugin should make amends. […]
  • 2023
    • Little Cameras. Gigapan(oramas). Big Hearts. Strap in (or hit eject) for a long blog ride. This has been one of those percolating drafts, meaning it has not progressed far from my head. But time is essencing. As there are a wave of steps to weave together, I am borrowing in all sense of honoring, not stealing, a section convention from […]
  • 2017
    • Putting the “C” in DS106 Nothing has been more essential and affirming and still fueling my every day work than being part of DS106. I’ve not taught a class since 2014 yet I still spend time queueing up Daily Creates and even yesterday cooking up a web form to collect new art for the web site. Since 2011, xMOOCs have […]
  • 2016
    • Scheduling Stuff to Happen in WordPress Most people will never need such a thing in a WordPress site, but outside the boxes of blogging, where WordPress is a Swiss Army Knife, there are situations where you need to run a script or do something on a regular interval. Maybe it’s polling social media. Maybe it’s updating some information about your site. […]
  • 2015
    • Pirates of the Moocibbean You’re an explorer out there on the intrepid waters of educational technology, sailing the hand made frigate with a few trusty colleagues. You’ve faced tsunamis, avalanches, world flattening forces. And then some IPO funded black ship from Silicon Valley sails in and plunders all your reputational booty. What else can an explorer do but pick […]
  • 2012
    • Animated Water During my hike today to see Dark Hollow waterfall (in Shenandoah National Park), I did some more experiments with doing some rapid sequence shot of the water detail. It was cloudy, but ay ISO 200 I set the aperture open enough for fast shutter speeds 1/1250, 1/3200 to freeze the motion, and taking a rapid […]
    • GIFfing History I’ve been a month in Fredericksburg, living just around the corner from locations of major Civil War battles 150 years ago. On Friday, I took a stroll down Sunken Road, a place where the Confederate Forces held a commanding position on a hill, and some 15,000 Union soldiers died trying to charge it. That’s war, […]
  • 2010
    • Today’s Lucky Stumbling Find: Turn Any Part of Web Page into Dashboard Widget Again, nothing warms this web dog’;s heart that accidentally discovering something useful. With my two daily photo habits (@dailyshoot and 2010/365 photos) I am continually having to seek out specific bits of information. For dailyshoot I check in the morning what the assignment is usually by a visit to their twitter page or checking an […]
  • 2009
    • Save a Word by Adoption 2009/365/63 Adoption Papers by cogdogblog posted 4 Mar ’09, 7.58pm MST PST on flickr Adoption is a serious consideration, one that requires planning. This is certainly not the case today. Be almost sheer accident, today I stumbled into Save The Words (Nancy White tweeted a ning site about visual poetry and I found the link […]
    • I’m a Visual Poet / Didn’t Know It Visual Poetry with phrasr by cogdogblog posted 4 Mar ’09, 7.58pm MST PST on flickr Oh this flickr based site was way too much fun. Read my deep philosophical poem here www.pimpampum.net/phrasr/?id=15932 With phrasr, you enter a phrase to illustrate, and for each word, it provides a photo from flickr. You can choose to swap […]
  • 2008
    • Dru Glu and Friends With Brian’s announcement that Gardner Campbell is visiting Vancouver this week (shucks, wish I could have extended the stay another week… or forever), I remain tickled at the shelf life of my silly graphic there— and more so that Gardner even sometimes refers to himself as “Dr Glu”. These were from a series of images […]
  • 2007
    • TXT COGDOG If you are a text messager, try this on your mobile: 41411 cogdog The latest, goofiest, likely mispelliest headline from CogDogBlog. Just what the world needs. This was created with TextMarks, a free service where you can set up a keyword so when someone TXTs it will get back either fixed response, or as I […]
  • 2006
    • What The Students Say Friday was our monthly meeting of the Ocotillo Online Learning Group (OLG) and we had a lot of anticipation, since this was our second annual meeting where we arranged a panel discussion with Maricopa students so they could tell us of their online learning experiences. Last year, it was lively, and packed the room with […]
  • 2004
    • Closing Some of the Comments All of the Time Back in November 2003, when I was wasting a lot of time dealing with blog spam, I wrote blogged the approach I took to close comments for this site after an entry had been up for 30 days. In a nutshell, I have a timed job calling a PHP script that rummages through the MT […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 14 posts previously published on March 4th

  • 2025
    • This is a Test This is a post of the CogDogBlog Federated Publishing System. This is only a test. Nah, it;s a real blog post! But my last post was not published to the Fediverse and the kind folks who make the software and actually respond like humans suggested the newest version of the ActivityPub plugin should make amends. […] &amp#x27A1;
  • 2023
    • Little Cameras. Gigapan(oramas). Big Hearts. Strap in (or hit eject) for a long blog ride. This has been one of those percolating drafts, meaning it has not progressed far from my head. But time is essencing. As there are a wave of steps to weave together, I am borrowing in all sense of honoring, not stealing, a section convention from […] &amp#x27A1;
  • 2017
    • Putting the “C” in DS106 Nothing has been more essential and affirming and still fueling my every day work than being part of DS106. I’ve not taught a class since 2014 yet I still spend time queueing up Daily Creates and even yesterday cooking up a web form to collect new art for the web site. Since 2011, xMOOCs have […] &amp#x27A1;
  • 2016
    • Scheduling Stuff to Happen in WordPress Most people will never need such a thing in a WordPress site, but outside the boxes of blogging, where WordPress is a Swiss Army Knife, there are situations where you need to run a script or do something on a regular interval. Maybe it’s polling social media. Maybe it’s updating some information about your site. […] &amp#x27A1;
  • 2015
    • Pirates of the Moocibbean You’re an explorer out there on the intrepid waters of educational technology, sailing the hand made frigate with a few trusty colleagues. You’ve faced tsunamis, avalanches, world flattening forces. And then some IPO funded black ship from Silicon Valley sails in and plunders all your reputational booty. What else can an explorer do but pick […] &amp#x27A1;
  • 2012
    • Animated Water During my hike today to see Dark Hollow waterfall (in Shenandoah National Park), I did some more experiments with doing some rapid sequence shot of the water detail. It was cloudy, but ay ISO 200 I set the aperture open enough for fast shutter speeds 1/1250, 1/3200 to freeze the motion, and taking a rapid […] &amp#x27A1;
    • GIFfing History I’ve been a month in Fredericksburg, living just around the corner from locations of major Civil War battles 150 years ago. On Friday, I took a stroll down Sunken Road, a place where the Confederate Forces held a commanding position on a hill, and some 15,000 Union soldiers died trying to charge it. That’s war, […] &amp#x27A1;
  • 2010
  • 2009
    • Save a Word by Adoption 2009/365/63 Adoption Papers by cogdogblog posted 4 Mar ’09, 7.58pm MST PST on flickr Adoption is a serious consideration, one that requires planning. This is certainly not the case today. Be almost sheer accident, today I stumbled into Save The Words (Nancy White tweeted a ning site about visual poetry and I found the link […] &amp#x27A1;
    • I’m a Visual Poet / Didn’t Know It Visual Poetry with phrasr by cogdogblog posted 4 Mar ’09, 7.58pm MST PST on flickr Oh this flickr based site was way too much fun. Read my deep philosophical poem here www.pimpampum.net/phrasr/?id=15932 With phrasr, you enter a phrase to illustrate, and for each word, it provides a photo from flickr. You can choose to swap […] &amp#x27A1;
  • 2008
    • Dru Glu and Friends With Brian’s announcement that Gardner Campbell is visiting Vancouver this week (shucks, wish I could have extended the stay another week… or forever), I remain tickled at the shelf life of my silly graphic there— and more so that Gardner even sometimes refers to himself as “Dr Glu”. These were from a series of images […] &amp#x27A1;
  • 2007
    • TXT COGDOG If you are a text messager, try this on your mobile: 41411 cogdog The latest, goofiest, likely mispelliest headline from CogDogBlog. Just what the world needs. This was created with TextMarks, a free service where you can set up a keyword so when someone TXTs it will get back either fixed response, or as I […] &amp#x27A1;
  • 2006
    • What The Students Say Friday was our monthly meeting of the Ocotillo Online Learning Group (OLG) and we had a lot of anticipation, since this was our second annual meeting where we arranged a panel discussion with Maricopa students so they could tell us of their online learning experiences. Last year, it was lively, and packed the room with […] &amp#x27A1;
  • 2004
    • Closing Some of the Comments All of the Time Back in November 2003, when I was wasting a lot of time dealing with blog spam, I wrote blogged the approach I took to close comments for this site after an entry had been up for 30 days. In a nutshell, I have a timed job calling a PHP script that rummages through the MT […] &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 *