“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 13 posts previously published on September 28th

  • 2024
    • Make An MacOS App to Run Command Line Stuff There are little things one can still do without AC (Asking ChatGPT). But first, a word about blogging! It was quite wonderful that after writing my post on installing the Photini app that I quickly got a comment from its developer, Jim Easterbrook. How does that happen? I’d guess he has a google alert for […]
  • 2018
    • One More TWU Portfolio Theme For the Road I’m wrapping up my work with Colin Madland at Trinity Western University creating a collection of clonable WordPress sites with custom child themes intended for the electronic portfolios TWU is proving for 500+ new students. As an extra piece of this work, I created for their WordPress Multisite a Network Admin dashboard widget that counts […]
  • 2016
  • 2015
    • A Lovely Bloom of UDGAgora Hashtags From our initial visits and surveys of participants, we knew twitter was not in wide use among the faculty participants of the UDG Agora project. We heard people mostly use Facebook, and WhatsApp for quick communication. In our first meetings, we collecting some data for participant’s twitter awareness (this was only sent out the first […]
  • 2011
    • I’m bad, I’m, nationwide There’s some ds106 radio smackdown looming for #bavastock weekend as to which crew has the best acts… While I have been in the EST since August 19, I am for all time zones (if you have no idea what I am talking about, just click away). Yeah, I am Bad, I am Nationwide  Share this […]
  • 2009
    • Retweetable cc licensed flickr photo shared by mikebaird Twitter retweets are an interesting phenemona; another example of the informal communication started by users– to RT means more or less to forward another person’s tweet out to your own network. On one level it seems to be an action of acknowledgment, say, if I retweet something that […]
  • 2006
    • Mindless, Time Wasting, Ego Chasing Vain Pursuit Hey, it is all about ME, right? So, if you thik this can measure the impact of your blog on the universe, give a spin of Bloginfluence, where you enter the URL of your blog (that was not 100% obvious on the form), and you need to dig out your Bloglines ID. Let the browser […]
  • 2005
    • Gastroenterology Opportunity Spam for breakfast, spam, for lunch, servings of spam keep coming at all times. Yummy, yummy spam. And it is so personal and it speaks to me: Subject: Gastroenterology Opportunity From: “Xxxxx Xxxxx” <xxxxxx@xxxx.com> Date: Wed, 28 Sep 2005 13:21:30 -0400 To: “XX List” <xxxx@xxx.com> Hello Doctor, How are you? I understand that you are […]
    • Student Life Blog and Wide Wild World of ePorts Just as pleasant as the Sonoran desert flowers that unexpectedly pop up in the Spring, comes a new blog from our Paradise Valley Community College– the Student Life Blog is not about personal “diaries”, but provides regularly updated program information from the college’s Student Life Center, including upcoming events at the PVCC Coffeehouse, photos, leadership […]
  • 2004
    • Ocotillo Action Group Calendars Fed to Web Sites In yet another feat of “faux syndication”, we now have our events database updating our Ocotillo Central and Action Group blog sites automatically. This provides a dynamic link from the info on the main Ocotillo Events calendar which has unique URLs for the following views: All Action Group Events General Ocotillo Events Learning Objects Action […]
    • Is Your CMS a Small House? flickr foto Small Houseavailable on my flickr Mickey has a new house but it is a bit of a squeeze Likey Mickey’s new dog house, sometimes a course management system that looks swell at the store ends up being pretty much a tight squeeze to live in. He’d rather run around in the yard getting […]
  • 2003
    • “X” Marks the Spot- My first Pure XHTML foray For the last two years, most of my web work has been deploying Cascading Style Sheets (one CSS styles several hundred web pages across our main
    • Blog Comment Spam #3 (of ???) Sigh. You get pretty excited, your tail wags, when you get an email notifcation of comments to one of your blog entries. You jump up and down when it is a batch of 4. However, like recently and more recently, we have recieved undesirable spam in this blog’s comments. How generous for “mNeuron” to provide […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 13 posts previously published on September 28th

  • 2024
    • Make An MacOS App to Run Command Line Stuff There are little things one can still do without AC (Asking ChatGPT). But first, a word about blogging! It was quite wonderful that after writing my post on installing the Photini app that I quickly got a comment from its developer, Jim Easterbrook. How does that happen? I’d guess he has a google alert for […] &amp#x27A1;
  • 2018
    • One More TWU Portfolio Theme For the Road I’m wrapping up my work with Colin Madland at Trinity Western University creating a collection of clonable WordPress sites with custom child themes intended for the electronic portfolios TWU is proving for 500+ new students. As an extra piece of this work, I created for their WordPress Multisite a Network Admin dashboard widget that counts […] &amp#x27A1;
  • 2016
  • 2015
    • A Lovely Bloom of UDGAgora Hashtags From our initial visits and surveys of participants, we knew twitter was not in wide use among the faculty participants of the UDG Agora project. We heard people mostly use Facebook, and WhatsApp for quick communication. In our first meetings, we collecting some data for participant’s twitter awareness (this was only sent out the first […] &amp#x27A1;
  • 2011
    • I’m bad, I’m, nationwide There’s some ds106 radio smackdown looming for #bavastock weekend as to which crew has the best acts… While I have been in the EST since August 19, I am for all time zones (if you have no idea what I am talking about, just click away). Yeah, I am Bad, I am Nationwide  Share this […] &amp#x27A1;
  • 2009
    • Retweetable cc licensed flickr photo shared by mikebaird Twitter retweets are an interesting phenemona; another example of the informal communication started by users– to RT means more or less to forward another person’s tweet out to your own network. On one level it seems to be an action of acknowledgment, say, if I retweet something that […] &amp#x27A1;
  • 2006
    • Mindless, Time Wasting, Ego Chasing Vain Pursuit Hey, it is all about ME, right? So, if you thik this can measure the impact of your blog on the universe, give a spin of Bloginfluence, where you enter the URL of your blog (that was not 100% obvious on the form), and you need to dig out your Bloglines ID. Let the browser […] &amp#x27A1;
  • 2005
    • Gastroenterology Opportunity Spam for breakfast, spam, for lunch, servings of spam keep coming at all times. Yummy, yummy spam. And it is so personal and it speaks to me: Subject: Gastroenterology Opportunity From: “Xxxxx Xxxxx” <xxxxxx@xxxx.com> Date: Wed, 28 Sep 2005 13:21:30 -0400 To: “XX List” <xxxx@xxx.com> Hello Doctor, How are you? I understand that you are […] &amp#x27A1;
    • Student Life Blog and Wide Wild World of ePorts Just as pleasant as the Sonoran desert flowers that unexpectedly pop up in the Spring, comes a new blog from our Paradise Valley Community College– the Student Life Blog is not about personal “diaries”, but provides regularly updated program information from the college’s Student Life Center, including upcoming events at the PVCC Coffeehouse, photos, leadership […] &amp#x27A1;
  • 2004
    • Ocotillo Action Group Calendars Fed to Web Sites In yet another feat of “faux syndication”, we now have our events database updating our Ocotillo Central and Action Group blog sites automatically. This provides a dynamic link from the info on the main Ocotillo Events calendar which has unique URLs for the following views: All Action Group Events General Ocotillo Events Learning Objects Action […] &amp#x27A1;
    • Is Your CMS a Small House? flickr foto Small Houseavailable on my flickr Mickey has a new house but it is a bit of a squeeze Likey Mickey’s new dog house, sometimes a course management system that looks swell at the store ends up being pretty much a tight squeeze to live in. He’d rather run around in the yard getting […] &amp#x27A1;
  • 2003
    • “X” Marks the Spot- My first Pure XHTML foray For the last two years, most of my web work has been deploying Cascading Style Sheets (one CSS styles several hundred web pages across our main &amp#x27A1;
    • Blog Comment Spam #3 (of ???) Sigh. You get pretty excited, your tail wags, when you get an email notifcation of comments to one of your blog entries. You jump up and down when it is a batch of 4. However, like recently and more recently, we have recieved undesirable spam in this blog’s comments. How generous for “mNeuron” to provide […] &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.

    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 *