“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 15 posts previously published on May 21st

  • 2025
    • Moms (a week late) and loving a universe (leaving as a placeholder for some AI generated excuses for not blogging). The draft has been in my head! Yes, with last weekend being Mother’s Day, celebrating was held here Saturday at home here that we call “Ursa Acres” or “Ursa” or just often “the universe.” There was home cooked food, family, flowers, and cards. […]
  • 2020
    • Breaking the Blogjam Hello, world. No, that’s been done before. But hello, empty WordPress editor, screen, even more sparse when the Gutenburger editor opens full screen. More white space. Forgive me blog, for it has been 11 days since my last post, and it’s been only 3 this month. Even doing my ALL CAPS tweets of impersonation has […]
  • 2019
    • Hello, World It’s been a while, WordPress blog. Been busy! That’s all to say now, more later. Just circling back to the first, long ago deleted, post- some make it harder than it should be. Hello. Featured image:  Share this barking on social media
  • 2018
    • Back to the (new) Nifty Fifty Twas maybe ten years ago in camera years I shifted back to using my DSLR after a run of using a compact digital camera. My go to lens, the one used for easily 90% of my photos, has been the Canon 50mm f/1.4 aka “The Nifty Fifty” But because of packing up, the 1700 mile […]
  • 2015
    • A Farrar Question This happened at the happy hour Tuesday after being at the Maricopa Teaching With Technology Conference. Across a noisy table, Bill Farrar posed an inquisitive question my way. When I worked at Maricopa, Bill was a psychology teacher at Mesa Community College, now he is at Estrella Mountain and the interim Director of their Center […]
  • 2014
    • Image Seek: A Mozilla Thimble Make creative commons licensed ( BY-NC-ND ) flickr photo shared by maury.mccown While many people do seem to know of the Mozilla Foundation’s efforts to Teach the Web, at the same time, many don’t. Besides a great set of tools (Thimble, Popcorn Maker, X-Ray Googles) they are building out a raft of resources, teaching kits and […]
  • 2013
    • Yahoo’s Carefully Honed Flickr Strategy Yahoo apparently brought in a high priced expert consultant to help them plan a rollout of a flickr update cc licensed ( BY NC SA ) flickr photo shared by WilWheaton First all the change in the layouts, which I admit I like as a design– it forefronts the image. But alas, the change did […]
  • 2012
    • Jumping from one ds106 class to the next cc licensed ( BY NC SA ) flickr photo shared by febbrile This is about as close as I might get to a reflection on my first round of teaching an on site section of ds106 at the University of Mary Washington- the class had barely wrapped and we were off into prep for Faculty […]
  • 2011
    • It Was Kind of Like This cc licensed flickr photo shared by @DrGarcia This photo says almost it all about the six hour ds106 radio jam camp at the Sanctuary in Vancouver, the night after Northern Voice 2011 closed. It went like this until 3am! If Jim Groom has any wondering where his voice went, look here (but it was worth […]
    • May Story a Day #21: Saturday Poem cc licensed ( BY NC SD ) flickr photo shared by your neighborhood librarian What else would you rather do on a Saturday? This looks like a lot more phone that silly rapture crap. Today’s bit is some combo of image (above) and me trying to read a short poem by Billy Collins, with some […]
  • 2010
    • 50 Ways Over Wooster Jon Breitenbucher invited me back again to do a remote (via Skype) presentation on 50 Web 2.0 Ways to Tell a Story for the week-long Instructional Technology Faculty Fellows program he and his crew run at the College of Wooster (by the way, they are rocking with wordpress multiuser there). When I did this last […]
  • 2009
    • 50+ Ways Plays in Wooster cc licensed flickr photo shared by cogdogblog By request, today I did a presentation on 50+ Web 2.0 Ways to Tell a Story via Skype to a group of faculty at the College of Wooster (Ohio). To do this they had my Skype video on one screen and the other had a web browser open […]
  • 2004
    • NoBlogDog This dog will not blog… for the next 4 days. I’m off for some backpack time around the edge of the Mogollon Rim, in the Coconino National Forest. Given drought conditions of the last several years, a rather dry winter, it will only be maybe a week or two before fire restrictions and closures shut […]
    • Mena Wants to Know How We Use MT Mena at SixApart is fishing for trackbacks to share how MovableType is being used. Here’s another one for the education realm. My initial foray with this CogDogBlog has been to document our instructional technology projects that support the 10 colleges of the Maricopa Community College systems, as well as commentary on technology. This server supports […]
  • 2003
    • Stomp Click Here One of my major, growling rotweiler pet peeves are the millions, no billions, or web pages that have “click here” links for hypertext. It completely defeats the entire concept of hypertext as an in-context connection to related content. Well-written hypertext subtly weaves the link by the choice of words used to indicate the link relationship. […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 15 posts previously published on May 21st

  • 2025
    • Moms (a week late) and loving a universe (leaving as a placeholder for some AI generated excuses for not blogging). The draft has been in my head! Yes, with last weekend being Mother’s Day, celebrating was held here Saturday at home here that we call “Ursa Acres” or “Ursa” or just often “the universe.” There was home cooked food, family, flowers, and cards. […] &amp#x27A1;
  • 2020
    • Breaking the Blogjam Hello, world. No, that’s been done before. But hello, empty WordPress editor, screen, even more sparse when the Gutenburger editor opens full screen. More white space. Forgive me blog, for it has been 11 days since my last post, and it’s been only 3 this month. Even doing my ALL CAPS tweets of impersonation has […] &amp#x27A1;
  • 2019
    • Hello, World It’s been a while, WordPress blog. Been busy! That’s all to say now, more later. Just circling back to the first, long ago deleted, post- some make it harder than it should be. Hello. Featured image:  Share this barking on social media &amp#x27A1;
  • 2018
    • Back to the (new) Nifty Fifty Twas maybe ten years ago in camera years I shifted back to using my DSLR after a run of using a compact digital camera. My go to lens, the one used for easily 90% of my photos, has been the Canon 50mm f/1.4 aka “The Nifty Fifty” But because of packing up, the 1700 mile […] &amp#x27A1;
  • 2015
    • A Farrar Question This happened at the happy hour Tuesday after being at the Maricopa Teaching With Technology Conference. Across a noisy table, Bill Farrar posed an inquisitive question my way. When I worked at Maricopa, Bill was a psychology teacher at Mesa Community College, now he is at Estrella Mountain and the interim Director of their Center […] &amp#x27A1;
  • 2014
    • Image Seek: A Mozilla Thimble Make creative commons licensed ( BY-NC-ND ) flickr photo shared by maury.mccown While many people do seem to know of the Mozilla Foundation’s efforts to Teach the Web, at the same time, many don’t. Besides a great set of tools (Thimble, Popcorn Maker, X-Ray Googles) they are building out a raft of resources, teaching kits and […] &amp#x27A1;
  • 2013
    • Yahoo’s Carefully Honed Flickr Strategy Yahoo apparently brought in a high priced expert consultant to help them plan a rollout of a flickr update cc licensed ( BY NC SA ) flickr photo shared by WilWheaton First all the change in the layouts, which I admit I like as a design– it forefronts the image. But alas, the change did […] &amp#x27A1;
  • 2012
    • Jumping from one ds106 class to the next cc licensed ( BY NC SA ) flickr photo shared by febbrile This is about as close as I might get to a reflection on my first round of teaching an on site section of ds106 at the University of Mary Washington- the class had barely wrapped and we were off into prep for Faculty […] &amp#x27A1;
  • 2011
    • It Was Kind of Like This cc licensed flickr photo shared by @DrGarcia This photo says almost it all about the six hour ds106 radio jam camp at the Sanctuary in Vancouver, the night after Northern Voice 2011 closed. It went like this until 3am! If Jim Groom has any wondering where his voice went, look here (but it was worth […] &amp#x27A1;
    • May Story a Day #21: Saturday Poem cc licensed ( BY NC SD ) flickr photo shared by your neighborhood librarian What else would you rather do on a Saturday? This looks like a lot more phone that silly rapture crap. Today’s bit is some combo of image (above) and me trying to read a short poem by Billy Collins, with some […] &amp#x27A1;
  • 2010
    • 50 Ways Over Wooster Jon Breitenbucher invited me back again to do a remote (via Skype) presentation on 50 Web 2.0 Ways to Tell a Story for the week-long Instructional Technology Faculty Fellows program he and his crew run at the College of Wooster (by the way, they are rocking with wordpress multiuser there). When I did this last […] &amp#x27A1;
  • 2009
    • 50+ Ways Plays in Wooster cc licensed flickr photo shared by cogdogblog By request, today I did a presentation on 50+ Web 2.0 Ways to Tell a Story via Skype to a group of faculty at the College of Wooster (Ohio). To do this they had my Skype video on one screen and the other had a web browser open […] &amp#x27A1;
  • 2004
    • NoBlogDog This dog will not blog… for the next 4 days. I’m off for some backpack time around the edge of the Mogollon Rim, in the Coconino National Forest. Given drought conditions of the last several years, a rather dry winter, it will only be maybe a week or two before fire restrictions and closures shut […] &amp#x27A1;
    • Mena Wants to Know How We Use MT Mena at SixApart is fishing for trackbacks to share how MovableType is being used. Here’s another one for the education realm. My initial foray with this CogDogBlog has been to document our instructional technology projects that support the 10 colleges of the Maricopa Community College systems, as well as commentary on technology. This server supports […] &amp#x27A1;
  • 2003
    • Stomp Click Here One of my major, growling rotweiler pet peeves are the millions, no billions, or web pages that have “click here” links for hypertext. It completely defeats the entire concept of hypertext as an in-context connection to related content. Well-written hypertext subtly weaves the link by the choice of words used to indicate the link relationship. […] &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 *