“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 18 posts previously published on January 28th

  • 2021
    • Dead Professors Society I was a tad skeptical when I saw the tweets being reshared from a student who was (rightfully if true) upset that his university was having dead professors teach classes. It was the macabre right out of a Netflix series idea of the Teaching Dead but then it is amplified by this Slate story, How […]
  • 2016
    • CogDog’s [Aluminum] Law of Photo Attribution Based on his extensive travel ,y colleague and good friend Bryan Alexander what he calls an “iron law”: Frequent travelers know what hotel internet connectivity can often be frustrating. But I hit upon a principle, many years ago, that lets us understand the connection between hotel and WiFi. I called it Alexander’s Iron Law of […]
  • 2015
    • The Making of You Show Episode 3 If you thought our series of videos was a bit strange, this one goes way off the rails and down the canyon, into another dimension. Maybe. Episode 3 introduces our Unit on Visual Design. In the video, hosts Brian and … Continued
    • On Theme Shopping “What’s the best theme for my WordPress site?” Is there a equivalent to the “Best Camera is the one in your hand” assertion? Probably not. In our work on The […]
  • 2014
    • A Grand Day at Maricopa cc licensed ( BY SA ) flickr photo shared by Alan Levine UPDATE Mar 18, 2014: Now with videos! Last Friday was an extra special day to visit friends and colleagues at the Maricopa Community Colleges- it was the second annual TechTalks event hosted at Scottsdale Community College. Last year, they changed the format of […]
    • My Own Portrait via Jonathan Worth I really prefer being behind the camera, but when I visited Jonathan Worth in November, how could I refuse his offer to have my portrait taken? I mean he is a pro photographer, and does his craft via a medium format film camera? Yes, Jonathan, I like it! I really really like it. It wont […]
    • #ds106radio, @Sourcefabric, and #WorldRadioDay February 13, 2014 is World Radio Day a UNESCO Project aimed at making the world aware of the power of radio as a platform for change. Via our friends at SourceFabric (makers of the open source Airtime software), ds106 radio is going to be part of the SourceFabric Radio day long program. What is special […]
  • 2013
    • Seeking Your True Stories of Open Sharing Have you ever had a pleasant, unexpected surprise happen as a result of having shared something online? I’m building out a new collection of these stories, having done it in 2009, 2010, and 2011. Previously I called these kinds of stories “Amazing”, but I got in a little trouble so now I am re-casting them […]
    • Blue Screen of Deathwish cc licensed ( BY SD ) flickr photo shared by cogdogblog Computers have feelings usually not expressed. They have hurt, anger, depression, and in this case, inordinate feelings of inferiority. Today’s Daily Create was to make a blue screen of death message using type only. My screen just wants to die and not come back. […]
  • 2012
    • @pizza Each time you send an email, and perhaps by extension of the convention, you should thank Ray Tomlinson and his inspiration, @rmando’s Pizza Shop in Cambridge, MA. Tomlinson, a graduate of MIT, started work as a programmer in the mid 1960s at Bolt, Beranek and Newman, the firm working with ARPANET to develop the first […]
  • 2005
    • A Few More Critters for Amy’s Menagerie (Courtesy of the Porcupine Anti-Defamation Scoiety) I am a card carrying porcupine. According to Amy Gahtan’s new series on “Handling Online Vermin”, the internet is swarming with undesirable, nasty “vermin” who apparently threaten the well being of innocent online souls: online media presents a deeply weird juxtaposition of isolation and connectedness, anonymity and identity, parts and whole. In this baffling environment […]
    • Wow… Adunct Faculty Jumps Feet First Into MLX and ePortfolio CDB readers may know of the struggles written here to solicit Maricopa people to share their instructional materials and teaching ideas in our Maricopa Learning eXchange (MLX) which is at almost 1100 items. Our efforts have included bribery and competition, but have yet to embrace physical threats. If I had a buck for every time […]
    • Putting MLX Feeds Where My Mouth Is I recently wrote some criticism of views that RSS feeds are “only for new stuff”, and given that I had a request today for a randomized Maricopa Learning eXchange feed, it was time to put my feeds where my mouth is/was. Before today, the feeds we generate as fixed static files (updated every hours as […]
    • RSS Blips on the Maricopa Radar I saw today that RSS might be starting to meme its way across our system. It takes time. This morning I got a call from a faculty member asking where she can get software to see RSS. I sent her googling in “Desktop RSS Aggregator” not recalling which of the 90 or so ones is […]
    • A Big Squared Circle Flickr Poster Check out this flickr spawned creation, the Squared Circle Poster. It is a mosaic of 2600 photos from the flickr Sqaured Circle Group (photos of circular objects inside a square image): This image was made by compositing 2600 photographs and arranging them in a fibonacci spiral, a form commonly seen in plants, such as sunflowers […]
    • Arf! Can Your Hear Me Now? Woof! More from the weird web department… can anyone guess who’s remaindered links I am plundering?? Anyhow, as a DOG themed corner of the web and a techie, I gave some serious perusal of Pet’s Mobility: PetsMobility™ Network, Inc. (PetsMobility™) is a wireless communications company that will be providing innovative wireless communication products and services to […]
    • One Down, A Billion To Go Okay, so “nofollow” is “nomiracle”… but today I got confirmation from a site in Span that one or molecules of spam were stomped: Hello Mr. Levine Sorry for the long time without news about our “problem” but we’ve been very busy making changes in our network in order to fix it. During this week we’ve changed […]
  • 2004
    • Sneaky E-mail Fraud Attempt It’s bad enough I am mass deleting virus generated e-mails (there were 66 this morning, about 8 hours later than the cleansing last night) but I got one on my home e-mail account, all be-decked with formal looking graphics. It made me suspicious….  Share this barking on social media
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 18 posts previously published on January 28th

  • 2021
    • Dead Professors Society I was a tad skeptical when I saw the tweets being reshared from a student who was (rightfully if true) upset that his university was having dead professors teach classes. It was the macabre right out of a Netflix series idea of the Teaching Dead but then it is amplified by this Slate story, How […] &amp#x27A1;
  • 2016
    • CogDog’s [Aluminum] Law of Photo Attribution Based on his extensive travel ,y colleague and good friend Bryan Alexander what he calls an “iron law”: Frequent travelers know what hotel internet connectivity can often be frustrating. But I hit upon a principle, many years ago, that lets us understand the connection between hotel and WiFi. I called it Alexander’s Iron Law of […] &amp#x27A1;
  • 2015
    • The Making of You Show Episode 3 If you thought our series of videos was a bit strange, this one goes way off the rails and down the canyon, into another dimension. Maybe. Episode 3 introduces our Unit on Visual Design. In the video, hosts Brian and … Continued &amp#x27A1;
    • On Theme Shopping “What’s the best theme for my WordPress site?” Is there a equivalent to the “Best Camera is the one in your hand” assertion? Probably not. In our work on The […] &amp#x27A1;
  • 2014
    • A Grand Day at Maricopa cc licensed ( BY SA ) flickr photo shared by Alan Levine UPDATE Mar 18, 2014: Now with videos! Last Friday was an extra special day to visit friends and colleagues at the Maricopa Community Colleges- it was the second annual TechTalks event hosted at Scottsdale Community College. Last year, they changed the format of […] &amp#x27A1;
    • My Own Portrait via Jonathan Worth I really prefer being behind the camera, but when I visited Jonathan Worth in November, how could I refuse his offer to have my portrait taken? I mean he is a pro photographer, and does his craft via a medium format film camera? Yes, Jonathan, I like it! I really really like it. It wont […] &amp#x27A1;
    • #ds106radio, @Sourcefabric, and #WorldRadioDay February 13, 2014 is World Radio Day a UNESCO Project aimed at making the world aware of the power of radio as a platform for change. Via our friends at SourceFabric (makers of the open source Airtime software), ds106 radio is going to be part of the SourceFabric Radio day long program. What is special […] &amp#x27A1;
  • 2013
    • Seeking Your True Stories of Open Sharing Have you ever had a pleasant, unexpected surprise happen as a result of having shared something online? I’m building out a new collection of these stories, having done it in 2009, 2010, and 2011. Previously I called these kinds of stories “Amazing”, but I got in a little trouble so now I am re-casting them […] &amp#x27A1;
    • Blue Screen of Deathwish cc licensed ( BY SD ) flickr photo shared by cogdogblog Computers have feelings usually not expressed. They have hurt, anger, depression, and in this case, inordinate feelings of inferiority. Today’s Daily Create was to make a blue screen of death message using type only. My screen just wants to die and not come back. […] &amp#x27A1;
  • 2012
    • @pizza Each time you send an email, and perhaps by extension of the convention, you should thank Ray Tomlinson and his inspiration, @rmando’s Pizza Shop in Cambridge, MA. Tomlinson, a graduate of MIT, started work as a programmer in the mid 1960s at Bolt, Beranek and Newman, the firm working with ARPANET to develop the first […] &amp#x27A1;
  • 2005
    • A Few More Critters for Amy’s Menagerie (Courtesy of the Porcupine Anti-Defamation Scoiety) I am a card carrying porcupine. According to Amy Gahtan’s new series on “Handling Online Vermin”, the internet is swarming with undesirable, nasty “vermin” who apparently threaten the well being of innocent online souls: online media presents a deeply weird juxtaposition of isolation and connectedness, anonymity and identity, parts and whole. In this baffling environment […] &amp#x27A1;
    • Wow… Adunct Faculty Jumps Feet First Into MLX and ePortfolio CDB readers may know of the struggles written here to solicit Maricopa people to share their instructional materials and teaching ideas in our Maricopa Learning eXchange (MLX) which is at almost 1100 items. Our efforts have included bribery and competition, but have yet to embrace physical threats. If I had a buck for every time […] &amp#x27A1;
    • Putting MLX Feeds Where My Mouth Is I recently wrote some criticism of views that RSS feeds are “only for new stuff”, and given that I had a request today for a randomized Maricopa Learning eXchange feed, it was time to put my feeds where my mouth is/was. Before today, the feeds we generate as fixed static files (updated every hours as […] &amp#x27A1;
    • RSS Blips on the Maricopa Radar I saw today that RSS might be starting to meme its way across our system. It takes time. This morning I got a call from a faculty member asking where she can get software to see RSS. I sent her googling in “Desktop RSS Aggregator” not recalling which of the 90 or so ones is […] &amp#x27A1;
    • A Big Squared Circle Flickr Poster Check out this flickr spawned creation, the Squared Circle Poster. It is a mosaic of 2600 photos from the flickr Sqaured Circle Group (photos of circular objects inside a square image): This image was made by compositing 2600 photographs and arranging them in a fibonacci spiral, a form commonly seen in plants, such as sunflowers […] &amp#x27A1;
    • Arf! Can Your Hear Me Now? Woof! More from the weird web department… can anyone guess who’s remaindered links I am plundering?? Anyhow, as a DOG themed corner of the web and a techie, I gave some serious perusal of Pet’s Mobility: PetsMobility™ Network, Inc. (PetsMobility™) is a wireless communications company that will be providing innovative wireless communication products and services to […] &amp#x27A1;
    • One Down, A Billion To Go Okay, so “nofollow” is “nomiracle”… but today I got confirmation from a site in Span that one or molecules of spam were stomped: Hello Mr. Levine Sorry for the long time without news about our “problem” but we’ve been very busy making changes in our network in order to fix it. During this week we’ve changed […] &amp#x27A1;
  • 2004
    • Sneaky E-mail Fraud Attempt It’s bad enough I am mass deleting virus generated e-mails (there were 66 this morning, about 8 hours later than the cleansing last night) but I got one on my home e-mail account, all be-decked with formal looking graphics. It made me suspicious….  Share this barking on social media &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 *