“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 20 posts previously published on May 3rd

  • 2024
    • Why the World Would End Without Storytelling On the Web With DS106s Today’s Daily Create made me do it! That listicle glorifying title would never have gotten past my clumsy on the keyboard fingertips. I was sent to Portent Title Generator to randomly generate a title about DS106. to put in a title. Yes, I deploy the Creative Tool No Artist or Writer Should be Without in May […]
    • Where Did/Will Everyone Go? There is a myth. Cue the string section. That there was once a place for all to gather, share, be festive, develop new connections, every course a hashtag, topple a few governments, people power. Then came an evil billionaire who ruined it all, those who gathered were cast out, a diaspora. No end. Yes the […]
  • 2018
    • A Big Box Full of a Whole Lot of Dad Memories A Levine family thing, well mine, was when asked what I wanted for a gift. Cleverly I strategized a means to get many gifts; I would request “A big box full of a whole bunch of little toys.” My parents always obliged. The calendar and later in the day my older system reminded me that […]
  • 2016
    • Assignment Bank Theme: Now With Embedded Media Icons Like atrophied brain muscles, tonight I was itching to do some code tinkering, so I added a new feature to the DS106 Assignment Bank Theme. It’s hardly anything the world was clamoring for (I am not sure if the world clamors to me anyhow). And I got to practice doing my git-ness right by making […]
  • 2015
    • Happy Birthday Dad, You Left the Nude Scenes “Behind” Yesterday, Dad, you would have been 89. I could accurately call you “old man” then? I imagine this 1926 era photo of you was taken in a photography studio, and did not launch a career as a shady film star. The clarity and wonder in your eyes is always what captured by attention in this […]
    • Juxtaposition in the Viewfinder Our sees see the world in wide and deep detail. Some of the magic, to me, of photography is that we use the frame of the lens to crop out just a portion. I’ve tried to see it, is in a way, creation by deletion (strangely producing no google search results, though Newspaper Blackout poetry […]
  • 2014
    • MOOCopoly: The Game I typically tell people the ds106 Daily Create is something that should take less than 20 minutes per day, hence today I spent maybe 2.5 hours on mine. It’s not a rule, it’s a choice. Today’s one was special though. I am visiting David Kernohan and Vivien Rolfe in Bristol, and David’s son Ben is […]
  • 2013
    • Contouring Your Way cc licensed ( BY SA ) flickr photo shared by cogdogblog The direct path from here to that ridge, was a huge loop to the left, and quite a bit of up and down to get there. The view from my back deck looks across the valley to a high ridge, one that looks continuous […]
    • Happy Belated Birthday Dad cc licensed ( BY SA ) flickr photo shared by cogdogblog Sorry I missed your birthday yesterday, Dad. I did get my calendar reminder, and woah, you’d be 87. Twenty years ago you were in Phoenix to climb Camelback Mountain for a special day. And the last one we celebrated together for your 75th is […]
    • The New Beatrice If you watched TV in the mid 1980s you should recall the smarmy commercial for some megacorp that apparently owned more food products than you could name (Airstream, Altoids, Avis, Blue Valley, Butterball, Culligan, Ekrich, Good & Plenty, Hunt’s, Jolly Rancher, Krispy Kreme, La Choy, Meadow Gold, Orville Redenbacher, Peter Pan, Playtex, Reddi Wip, Samsonite, […]
  • 2012
    • Early On The X Just wanna stake my claim… Look for big announcement soon about CogDogx cause just like the ‘i” prefix of a few years ago, an “x” suffix is the new shnizzle — Alan Levine (@cogdog) December 30, 2011 Of course, the “big announcement” is 404, because I was just playing. But the “x” factor is going […]
  • 2011
    • This is a Call (for new Amazing Stories of Openness) I’m doing a third round of Amazing Stories of Openness, as an invited keynote for the Spring ETUG Workshop (June 2-3 in what is usually described as “lovely Nelson, BC) . An Amazing Story is you sharing an example of something unexpected that happened as a result of you sharing something on the open web- […]
    • Story a Day in May #2: Animated Bryan For day 2 od the digital story a day month, I am strong. I am not wavering. In honor of the crazy movement that started ds106 even before it started, I made an animated GIF of my good friend Bryan Alexander. I visited with him and his family yesterday, and besides playing nerf gun wars […]
  • 2006
    • Gone West flickr foto Window Vignettesavailable on my flickr There is some sort of story told in these window reflections, I am just not sure what they are. I’m in San Francisco for 2 days of NMC meetings… if time allows, I am eager to get out on the streets with my camera. My memories roll back […]
    • Not Sure If I Would Order This Online While checking out some office supply items, the first bulleted one made me take a second look: Yeah, you could pay for the change but what actually arrives in the brown package left on your doorstep?  Share this barking on social media
    • Rocking Podcasting GarageBanding I am just scraping the surface with a first experience creating an enhanced podcast in GarageBand, but software designers take note– this is the way podcast editing should happen. Drag and drop your mp3 music into a sound track. drop or record your voide in a voice track, drop image files into the podcast track […]
    • First (not Last) BSOD It was bound to happen, the first Blue Screen Of Death on the Bootcamped XP side of my MacBookPro (wow, I might order the T-shirt). I was trying to install Skype– well it did install, but running it brought me BSOD. The first time, on reboot, XP did its repair job; the second time it […]
  • 2005
    • Spammers Again At Every Web Form Oriface Previously I have documented the new Diagnostic and Statistical Manual of Mental Disorders (DSM-IV) diagnosis of SpamNymphomania, the sad, desperate attempt to stick Porn Pill Casino links into any web form that contains a textarea and a submit button. In extremely sad cases, they continue to do so when there is no payoff at all, […]
  • 2004
    • Dan Sez Bloggers Need to Get Out More… So I Did Actually, my weekend adventure was not influenced at all by Dan Gillmor’s post One Reason Bloggers Need to Get Out More , but I thought I would not give him credit anyhow 😉 Getting out is good for the mind, soul, and body, so Sunday morning, from our escape hideaway on Strawberry Arizona, I mounted […]
    • FeedSweep- Free RSS to JavaScript But Broad Claims Just like wildflowers or weeds, springing up across the net are more services to help you use RSS in your web sites. FeedSweep just came on the scene, in time to help Amy sweep her “webfeeds”: Anyone that wants to syndicate RSS and Atom feeds on their web sites would be well-served to take a […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 20 posts previously published on May 3rd

  • 2024
    • Why the World Would End Without Storytelling On the Web With DS106s Today’s Daily Create made me do it! That listicle glorifying title would never have gotten past my clumsy on the keyboard fingertips. I was sent to Portent Title Generator to randomly generate a title about DS106. to put in a title. Yes, I deploy the Creative Tool No Artist or Writer Should be Without in May […] &amp#x27A1;
    • Where Did/Will Everyone Go? There is a myth. Cue the string section. That there was once a place for all to gather, share, be festive, develop new connections, every course a hashtag, topple a few governments, people power. Then came an evil billionaire who ruined it all, those who gathered were cast out, a diaspora. No end. Yes the […] &amp#x27A1;
  • 2018
    • A Big Box Full of a Whole Lot of Dad Memories A Levine family thing, well mine, was when asked what I wanted for a gift. Cleverly I strategized a means to get many gifts; I would request “A big box full of a whole bunch of little toys.” My parents always obliged. The calendar and later in the day my older system reminded me that […] &amp#x27A1;
  • 2016
    • Assignment Bank Theme: Now With Embedded Media Icons Like atrophied brain muscles, tonight I was itching to do some code tinkering, so I added a new feature to the DS106 Assignment Bank Theme. It’s hardly anything the world was clamoring for (I am not sure if the world clamors to me anyhow). And I got to practice doing my git-ness right by making […] &amp#x27A1;
  • 2015
    • Happy Birthday Dad, You Left the Nude Scenes “Behind” Yesterday, Dad, you would have been 89. I could accurately call you “old man” then? I imagine this 1926 era photo of you was taken in a photography studio, and did not launch a career as a shady film star. The clarity and wonder in your eyes is always what captured by attention in this […] &amp#x27A1;
    • Juxtaposition in the Viewfinder Our sees see the world in wide and deep detail. Some of the magic, to me, of photography is that we use the frame of the lens to crop out just a portion. I’ve tried to see it, is in a way, creation by deletion (strangely producing no google search results, though Newspaper Blackout poetry […] &amp#x27A1;
  • 2014
    • MOOCopoly: The Game I typically tell people the ds106 Daily Create is something that should take less than 20 minutes per day, hence today I spent maybe 2.5 hours on mine. It’s not a rule, it’s a choice. Today’s one was special though. I am visiting David Kernohan and Vivien Rolfe in Bristol, and David’s son Ben is […] &amp#x27A1;
  • 2013
    • Contouring Your Way cc licensed ( BY SA ) flickr photo shared by cogdogblog The direct path from here to that ridge, was a huge loop to the left, and quite a bit of up and down to get there. The view from my back deck looks across the valley to a high ridge, one that looks continuous […] &amp#x27A1;
    • Happy Belated Birthday Dad cc licensed ( BY SA ) flickr photo shared by cogdogblog Sorry I missed your birthday yesterday, Dad. I did get my calendar reminder, and woah, you’d be 87. Twenty years ago you were in Phoenix to climb Camelback Mountain for a special day. And the last one we celebrated together for your 75th is […] &amp#x27A1;
    • The New Beatrice If you watched TV in the mid 1980s you should recall the smarmy commercial for some megacorp that apparently owned more food products than you could name (Airstream, Altoids, Avis, Blue Valley, Butterball, Culligan, Ekrich, Good & Plenty, Hunt’s, Jolly Rancher, Krispy Kreme, La Choy, Meadow Gold, Orville Redenbacher, Peter Pan, Playtex, Reddi Wip, Samsonite, […] &amp#x27A1;
  • 2012
    • Early On The X Just wanna stake my claim… Look for big announcement soon about CogDogx cause just like the ‘i” prefix of a few years ago, an “x” suffix is the new shnizzle — Alan Levine (@cogdog) December 30, 2011 Of course, the “big announcement” is 404, because I was just playing. But the “x” factor is going […] &amp#x27A1;
  • 2011
    • This is a Call (for new Amazing Stories of Openness) I’m doing a third round of Amazing Stories of Openness, as an invited keynote for the Spring ETUG Workshop (June 2-3 in what is usually described as “lovely Nelson, BC) . An Amazing Story is you sharing an example of something unexpected that happened as a result of you sharing something on the open web- […] &amp#x27A1;
    • Story a Day in May #2: Animated Bryan For day 2 od the digital story a day month, I am strong. I am not wavering. In honor of the crazy movement that started ds106 even before it started, I made an animated GIF of my good friend Bryan Alexander. I visited with him and his family yesterday, and besides playing nerf gun wars […] &amp#x27A1;
  • 2006
    • Gone West flickr foto Window Vignettesavailable on my flickr There is some sort of story told in these window reflections, I am just not sure what they are. I’m in San Francisco for 2 days of NMC meetings… if time allows, I am eager to get out on the streets with my camera. My memories roll back […] &amp#x27A1;
    • Not Sure If I Would Order This Online While checking out some office supply items, the first bulleted one made me take a second look: Yeah, you could pay for the change but what actually arrives in the brown package left on your doorstep?  Share this barking on social media &amp#x27A1;
    • Rocking Podcasting GarageBanding I am just scraping the surface with a first experience creating an enhanced podcast in GarageBand, but software designers take note– this is the way podcast editing should happen. Drag and drop your mp3 music into a sound track. drop or record your voide in a voice track, drop image files into the podcast track […] &amp#x27A1;
    • First (not Last) BSOD It was bound to happen, the first Blue Screen Of Death on the Bootcamped XP side of my MacBookPro (wow, I might order the T-shirt). I was trying to install Skype– well it did install, but running it brought me BSOD. The first time, on reboot, XP did its repair job; the second time it […] &amp#x27A1;
  • 2005
    • Spammers Again At Every Web Form Oriface Previously I have documented the new Diagnostic and Statistical Manual of Mental Disorders (DSM-IV) diagnosis of SpamNymphomania, the sad, desperate attempt to stick Porn Pill Casino links into any web form that contains a textarea and a submit button. In extremely sad cases, they continue to do so when there is no payoff at all, […] &amp#x27A1;
  • 2004
    • Dan Sez Bloggers Need to Get Out More… So I Did Actually, my weekend adventure was not influenced at all by Dan Gillmor’s post One Reason Bloggers Need to Get Out More , but I thought I would not give him credit anyhow 😉 Getting out is good for the mind, soul, and body, so Sunday morning, from our escape hideaway on Strawberry Arizona, I mounted […] &amp#x27A1;
    • FeedSweep- Free RSS to JavaScript But Broad Claims Just like wildflowers or weeds, springing up across the net are more services to help you use RSS in your web sites. FeedSweep just came on the scene, in time to help Amy sweep her “webfeeds”: Anyone that wants to syndicate RSS and Atom feeds on their web sites would be well-served to take a […] &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 *