“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 May 29th

  • 2023
    • Changing Up, “Decripting” My Podcast Methods, Eh, Ai? Eh? You know you’ve been around this game a grey haired time if you remember that podcasting had something to do with this thing called RSS. I found shreds of workshops I did back at Maricopa in 2006 “Podcasting, Schmodcasting…. What’s All the Hype?” and smiled I was using this web audio tool called Odeo who’s […]
  • 2021
    • Seeing the Bookmark is Believing I Read it All It must say something without saying that getting to the end of one book a year is blog worthy. Let it be said unsaid, but there is my bookmark in the index pages at the end of Errol Morris’s Believing is Seeing (Observations on the Mysteries of Photography). The path here was one of those […]
  • 2020
    • One in Ten Thousand Odds of Drawing the Fifth Card Even just writing this title I anticipate the automated spam offering links to poker web sites. Oh well. I can’t pass up a story of serendipity and ancient web technology. The first card is a tweet from Jon Becker, who for quite some time has had his online students at VCU take a spin at […]
  • 2019
    • @ontarioextend Domain Camp Preview Even while preparation falls into place, it was due to to put out a promo video for another round of Ontario Extend Domain Camp. In the first year of the project, Domain of One’s Own was a component of this provincial-wide program to empower educators with a learning-focused approach to technology integration. While not required […]
  • 2018
    • Get Your Twitter TAGS on Probably one way to make sense of activity of interest twitter is explore some numbers and visualization of them. Data visualization gets technically gnarly quick, but my go to tool ever since he first announce it is Martin Hawksey’s Twitter TAGS If you have a Google account, you can not only create a system to […]
  • 2016
    • The Purity of Numerical Data Data. Big. Analytics. I don’t dismiss a potential, the efforts to “harness” it. I just don’t find it all that interesting. But my data? Different. I’ve been running my own metrics for maybe two months. I may hate dieting more than I hate running. The only time I lost a good amount of weight was […]
    • A #DS106 Spontaneous Breakout of Flag Hands It all started with a tweet from someone I don’t know. Today’s DS106 Daily Create was about showing how “massive” it is: #ds106 #dailycreate #tdc1602 Show the world how DS106 is MASSIVE https://t.co/y7RxyNZJva pic.twitter.com/hqu7qXFZje — ds106 Daily Create (@ds106dc) May 28, 2016 And I smiled seeing how @g1000p, a twitter account with 4 total tweets, […]
  • 2013
    • I Can Read Series: Eye of the Beholder Making the Twilight Zone approachable for new readers… This is a slight riff from the I Can Read Movies ds106 design assignment, I did not use the templates, but instead mocked it from Biscuit Goes to School I started with the idea of the Janet Tyler character facing the “beautiful” people maybe putting a mirror […]
    • Old Webs I Wove: Negative Reinforcement University A rather surprising email floated through the box yesterday: I’m a librarian at a college in Pennsylvania, and I’m trying to track down a current link to Negative Reinforcement University. One of our Animal Science professors has shared the resource with his students in the past. He speaks very highly of the site and would […]
    • My Editor is a B**** (Twilight Zone Sound Story) I dread those meetings with my editor. She is rather harsh. Just the way she looks down on me. I have a new manuscript for her to review. I just cannot predict how she will react. This was our last meeting. This is my go at a new ds106 Sound Effects Story: Tell a story […]
    • The Past and the Past Of the 30,000 photos I have uploaded to flickr in the last 9 years I’d guess more than a third were taken in my 1/3 acre yard or house. My guess might be totally off, but I have yet to find on a given day that I cannot locate something new, different. Being home this […]
  • 2012
    • Letter Home from Camp Magic Macguffin (week 1) Part of the weekly recaps of ds06 we are asking our participants to do is a letter home from camp… Dear Mom and Dad, Wow, what a first week from Camp Magic Macguffin, it is a lucky thing I packed me favorite, stylish pants. It was one thing to go away to Camp Glyndon in […]
  • 2010
    • Those Darn Kids: WordPress Child Themes cc licensed flickr photo shared by gianΩmerz I’m regretting not getting started my series on WordPress 3.0 and custom content types; a big chunk remains to be explained, but that has to wait till after a few days of vacation. But there was something Jim Groom mentioned that I was going to tackle later, but […]
  • 2004
    • LearningTimes Interview Down Under: Alan on the Barbie? From some previous visits with excellent learning leaders in Australia and continued contacts with colleagues there, I was asked to be audio interviewed online June 2 (here) via the LearningTimes site “Live Session: RSS, Blogging and What it Means for Teaching and Learning” (It is free, but you need to join LearningTimes): Participate in this […]
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 May 29th

  • 2023
    • Changing Up, “Decripting” My Podcast Methods, Eh, Ai? Eh? You know you’ve been around this game a grey haired time if you remember that podcasting had something to do with this thing called RSS. I found shreds of workshops I did back at Maricopa in 2006 “Podcasting, Schmodcasting…. What’s All the Hype?” and smiled I was using this web audio tool called Odeo who’s […] &amp#x27A1;
  • 2021
    • Seeing the Bookmark is Believing I Read it All It must say something without saying that getting to the end of one book a year is blog worthy. Let it be said unsaid, but there is my bookmark in the index pages at the end of Errol Morris’s Believing is Seeing (Observations on the Mysteries of Photography). The path here was one of those […] &amp#x27A1;
  • 2020
    • One in Ten Thousand Odds of Drawing the Fifth Card Even just writing this title I anticipate the automated spam offering links to poker web sites. Oh well. I can’t pass up a story of serendipity and ancient web technology. The first card is a tweet from Jon Becker, who for quite some time has had his online students at VCU take a spin at […] &amp#x27A1;
  • 2019
    • @ontarioextend Domain Camp Preview Even while preparation falls into place, it was due to to put out a promo video for another round of Ontario Extend Domain Camp. In the first year of the project, Domain of One’s Own was a component of this provincial-wide program to empower educators with a learning-focused approach to technology integration. While not required […] &amp#x27A1;
  • 2018
    • Get Your Twitter TAGS on Probably one way to make sense of activity of interest twitter is explore some numbers and visualization of them. Data visualization gets technically gnarly quick, but my go to tool ever since he first announce it is Martin Hawksey’s Twitter TAGS If you have a Google account, you can not only create a system to […] &amp#x27A1;
  • 2016
    • The Purity of Numerical Data Data. Big. Analytics. I don’t dismiss a potential, the efforts to “harness” it. I just don’t find it all that interesting. But my data? Different. I’ve been running my own metrics for maybe two months. I may hate dieting more than I hate running. The only time I lost a good amount of weight was […] &amp#x27A1;
    • A #DS106 Spontaneous Breakout of Flag Hands It all started with a tweet from someone I don’t know. Today’s DS106 Daily Create was about showing how “massive” it is: #ds106 #dailycreate #tdc1602 Show the world how DS106 is MASSIVE https://t.co/y7RxyNZJva pic.twitter.com/hqu7qXFZje — ds106 Daily Create (@ds106dc) May 28, 2016 And I smiled seeing how @g1000p, a twitter account with 4 total tweets, […] &amp#x27A1;
  • 2013
    • I Can Read Series: Eye of the Beholder Making the Twilight Zone approachable for new readers… This is a slight riff from the I Can Read Movies ds106 design assignment, I did not use the templates, but instead mocked it from Biscuit Goes to School I started with the idea of the Janet Tyler character facing the “beautiful” people maybe putting a mirror […] &amp#x27A1;
    • Old Webs I Wove: Negative Reinforcement University A rather surprising email floated through the box yesterday: I’m a librarian at a college in Pennsylvania, and I’m trying to track down a current link to Negative Reinforcement University. One of our Animal Science professors has shared the resource with his students in the past. He speaks very highly of the site and would […] &amp#x27A1;
    • My Editor is a B**** (Twilight Zone Sound Story) I dread those meetings with my editor. She is rather harsh. Just the way she looks down on me. I have a new manuscript for her to review. I just cannot predict how she will react. This was our last meeting. This is my go at a new ds106 Sound Effects Story: Tell a story […] &amp#x27A1;
    • The Past and the Past Of the 30,000 photos I have uploaded to flickr in the last 9 years I’d guess more than a third were taken in my 1/3 acre yard or house. My guess might be totally off, but I have yet to find on a given day that I cannot locate something new, different. Being home this […] &amp#x27A1;
  • 2012
    • Letter Home from Camp Magic Macguffin (week 1) Part of the weekly recaps of ds06 we are asking our participants to do is a letter home from camp… Dear Mom and Dad, Wow, what a first week from Camp Magic Macguffin, it is a lucky thing I packed me favorite, stylish pants. It was one thing to go away to Camp Glyndon in […] &amp#x27A1;
  • 2010
    • Those Darn Kids: WordPress Child Themes cc licensed flickr photo shared by gianΩmerz I’m regretting not getting started my series on WordPress 3.0 and custom content types; a big chunk remains to be explained, but that has to wait till after a few days of vacation. But there was something Jim Groom mentioned that I was going to tackle later, but […] &amp#x27A1;
  • 2004
    • LearningTimes Interview Down Under: Alan on the Barbie? From some previous visits with excellent learning leaders in Australia and continued contacts with colleagues there, I was asked to be audio interviewed online June 2 (here) via the LearningTimes site “Live Session: RSS, Blogging and What it Means for Teaching and Learning” (It is free, but you need to join LearningTimes): Participate in this […] &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 *