“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 September 18th

  • 2021
    • A Duct Tape WordPress Plugin for Redirecting Broken Links Profound statement ahead. The web is made of links. Except when they don’t work. This trail all began with a throw away tweet: Yes, I have that old blogger habit of looking through old posts or using them as my (cue the operatic swelling music)… Knowledge Management System. So often, “or mansy days” as the […]
  • 2015
    • Here We Go Again After a glorious almost 8 weeks at home, the bag is packed, I’m ready to go (cue the music) on a madcap tour. The next six weeks is a nutty series of trips by planes, cars, trains for visiting friends, A Great Bike Race Book project, visiting friends, keeping tabs on UdG Agora and Project […]
  • 2013
    • Redoing the Past Pose Maybe my favorite image of my Mom was one I made on her last visit to my home in Arizona. She knew, and obliged in retelling, the stories of her past. I remember asking her about her high school years, because to me, in her photo, she looked so much more mature than high school. […]
  • 2012
    • The New T-Shirts Are Here! The New T-Shirts Are Here! People do get excited when things are delivered… http://www.youtube.com/watch?v=sqqjVyOYmow @timmmmyboy Hard rain falling here. Got my #ds106 shirt yesterday. THANK YOU @jimgroom What about the socks? 🙂 — Ben (@BenjaminHarwood) September 18, 2012 @jimgroom Received my #ds106 t-shirt yesterday. Yay! Thank you! 🙂 — linda3dots (@linda3dots) September 12, 2012 #ds106 tshirt! Yay! — David Kernohan […]
  • 2011
    • Coach Kevin, Soccer, Life on ds106 Radio cc licensed ( BY ) flickr photo shared by cogdogblog Kevin and I go back to Mr Murray’s 9th grade Biology class — and so we sat some 34 years later in his home in State College, PA rejoicing a long lived friendship. And what’s best is that only part of it is reliving the […]
    • The Guitar Abides That is 31 years between a photo of me at 17 in my parent’s basement and just last night in my friend’s son’s basement. Much chnages and miles between. But that blonde telecaster is the same as it ever was, a thing that I just enjoyed holding, then and now. I have written up the […]
    • Cookielove Keeps Flowing Today is Sunday, I am reaching for the phone to call Mom (still, forever in my “favorites”), but alas, set it down. My day is brightened. Yesterday while at my friend’s soccer game, I saw a butterfly waft over the field. The #cookielove that started September 4 rolls on — and I keep piling it […]
    • This is How We Roll: ds106 Growlercast with Cole This first order of business after arriving at Cole Camplese‘s house (past a huge hello hug) was a trip to Otto’s to fill up the fuel tanks for the evening’s activities… cc licensed ( BY ) flickr photo shared by cogdogblog Well, actually before all this was a round of play in the front yard […]
  • 2009
    • HTML in My Yard cc licensed flickr photo shared by cogdogblog It was not until I was done with placing these last stepping stones for my walkway, that I noticed that my playfulness with the angled rocks created an HTML tag. My yard now has italic text and will ruin the layout of the rest of the neighborhood since […]
  • 2008
    • EduBloggerCon in Shanghai Jeff Watching Jakes film Brian by cogdogblog posted 18 Sep ’08, 8.54pm MDT PST on flickr Learning 2.008 EduBloggerCon (Shanghai) www.edubloggercon.com/Learning+2.008+Edubloggercon Before the opening of the Learning 2.008 conference, a group of conference attendees and other local bloggers met up for breakfast and conversation about out favorite topic. Not only were there pictures and conversation, […]
  • 2006
    • Blog No Blog I amidst a mostly blogless stretch, chalked up to a hellacious travel schedule recently without even much time to think and breath, much less write. Just got back home Friday night, technically Saturday at 2:00 AM on the last leg of a cross country circle. The last end was four days in Austin for another […]
  • 2005
    • See, Feel, Taste Your Del.icio.us Soup: Revealacious The newest mind-blowing add on for del.icio.us users must be Revealacious billed as “revealing the way you use del.icio.us”: Revealicious is a set of graphic visualisations for your del.icio.us account that allow you to browse, search and select tags, as well as viewing posts matching them. * SpaceNav (demo), which allows you to explore the […]
    • Communities are Much More Than a Place I’ve been guilty of this several times over, but its easy to fall into the Field of Dreams Syndrome (FoDS) by focusing on the construction of the place (“build a virtual community and they will come”). I’ve rambled before about this, that if you look at real communities of people, it is just more than […]
    • NetGen Learners: Where’s The Action? Check the Assumptions at the (Classroom) Door? It seems you cannot find an educational technology blog, publication, presentation these days that do not somehow mention or directly address the NetGeneration learners (and most roads linking to a great EDUCAUSE e-publication). This is a Good Thing… to a degree. I find two things lately tickling my critical bones– (1) Recognizing is just a […]
  • 2003
    • Learning Objects + RSS + Blogs: The Lora and Boris Show at NMC Online Conference Wow. In a very un-MERLOT-ian scheduling coup, we have the opening session (right after Wayne Hodgins! October 14) for a presentation at the NMC Online Conference on Learning Objects. For those that missed the MERLOT 2003 presentation, this is your chance to see it during this conference, except now we get to add the razzle-dazzle […]
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 September 18th

  • 2021
    • A Duct Tape WordPress Plugin for Redirecting Broken Links Profound statement ahead. The web is made of links. Except when they don’t work. This trail all began with a throw away tweet: Yes, I have that old blogger habit of looking through old posts or using them as my (cue the operatic swelling music)… Knowledge Management System. So often, “or mansy days” as the […] &amp#x27A1;
  • 2015
    • Here We Go Again After a glorious almost 8 weeks at home, the bag is packed, I’m ready to go (cue the music) on a madcap tour. The next six weeks is a nutty series of trips by planes, cars, trains for visiting friends, A Great Bike Race Book project, visiting friends, keeping tabs on UdG Agora and Project […] &amp#x27A1;
  • 2013
    • Redoing the Past Pose Maybe my favorite image of my Mom was one I made on her last visit to my home in Arizona. She knew, and obliged in retelling, the stories of her past. I remember asking her about her high school years, because to me, in her photo, she looked so much more mature than high school. […] &amp#x27A1;
  • 2012
    • The New T-Shirts Are Here! The New T-Shirts Are Here! People do get excited when things are delivered… http://www.youtube.com/watch?v=sqqjVyOYmow @timmmmyboy Hard rain falling here. Got my #ds106 shirt yesterday. THANK YOU @jimgroom What about the socks? 🙂 — Ben (@BenjaminHarwood) September 18, 2012 @jimgroom Received my #ds106 t-shirt yesterday. Yay! Thank you! 🙂 — linda3dots (@linda3dots) September 12, 2012 #ds106 tshirt! Yay! — David Kernohan […] &amp#x27A1;
  • 2011
    • Coach Kevin, Soccer, Life on ds106 Radio cc licensed ( BY ) flickr photo shared by cogdogblog Kevin and I go back to Mr Murray’s 9th grade Biology class — and so we sat some 34 years later in his home in State College, PA rejoicing a long lived friendship. And what’s best is that only part of it is reliving the […] &amp#x27A1;
    • The Guitar Abides That is 31 years between a photo of me at 17 in my parent’s basement and just last night in my friend’s son’s basement. Much chnages and miles between. But that blonde telecaster is the same as it ever was, a thing that I just enjoyed holding, then and now. I have written up the […] &amp#x27A1;
    • Cookielove Keeps Flowing Today is Sunday, I am reaching for the phone to call Mom (still, forever in my “favorites”), but alas, set it down. My day is brightened. Yesterday while at my friend’s soccer game, I saw a butterfly waft over the field. The #cookielove that started September 4 rolls on — and I keep piling it […] &amp#x27A1;
    • This is How We Roll: ds106 Growlercast with Cole This first order of business after arriving at Cole Camplese‘s house (past a huge hello hug) was a trip to Otto’s to fill up the fuel tanks for the evening’s activities… cc licensed ( BY ) flickr photo shared by cogdogblog Well, actually before all this was a round of play in the front yard […] &amp#x27A1;
  • 2009
    • HTML in My Yard cc licensed flickr photo shared by cogdogblog It was not until I was done with placing these last stepping stones for my walkway, that I noticed that my playfulness with the angled rocks created an HTML tag. My yard now has italic text and will ruin the layout of the rest of the neighborhood since […] &amp#x27A1;
  • 2008
    • EduBloggerCon in Shanghai Jeff Watching Jakes film Brian by cogdogblog posted 18 Sep ’08, 8.54pm MDT PST on flickr Learning 2.008 EduBloggerCon (Shanghai) www.edubloggercon.com/Learning+2.008+Edubloggercon Before the opening of the Learning 2.008 conference, a group of conference attendees and other local bloggers met up for breakfast and conversation about out favorite topic. Not only were there pictures and conversation, […] &amp#x27A1;
  • 2006
    • Blog No Blog I amidst a mostly blogless stretch, chalked up to a hellacious travel schedule recently without even much time to think and breath, much less write. Just got back home Friday night, technically Saturday at 2:00 AM on the last leg of a cross country circle. The last end was four days in Austin for another […] &amp#x27A1;
  • 2005
    • See, Feel, Taste Your Del.icio.us Soup: Revealacious The newest mind-blowing add on for del.icio.us users must be Revealacious billed as “revealing the way you use del.icio.us”: Revealicious is a set of graphic visualisations for your del.icio.us account that allow you to browse, search and select tags, as well as viewing posts matching them. * SpaceNav (demo), which allows you to explore the […] &amp#x27A1;
    • Communities are Much More Than a Place I’ve been guilty of this several times over, but its easy to fall into the Field of Dreams Syndrome (FoDS) by focusing on the construction of the place (“build a virtual community and they will come”). I’ve rambled before about this, that if you look at real communities of people, it is just more than […] &amp#x27A1;
    • NetGen Learners: Where’s The Action? Check the Assumptions at the (Classroom) Door? It seems you cannot find an educational technology blog, publication, presentation these days that do not somehow mention or directly address the NetGeneration learners (and most roads linking to a great EDUCAUSE e-publication). This is a Good Thing… to a degree. I find two things lately tickling my critical bones– (1) Recognizing is just a […] &amp#x27A1;
  • 2003
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 *