“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.
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.
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 March 20th
- 2024
- Stop (I hope) Logging in to that Old WordPress Site In the spirit of Tom’s short tech notes to oneself… I archived a WordPress site I made a few years back for Cori’s high schools students to do some (anonymous) online writing. The site is really just to keep as an archive (and honestly it would be better to convert to static HTML, put that […]
- Redoing the Unfamiliar Familiar Somewhere out there a man in Iceland will smile. I’ve never met, known, or contacted him, but from a Mastodon repost by Joe Murphy, Baldour wrote delightfully about a precious (in terms of value) habit that made me smile: Somewhere this blog may light up an RSS reader in Iceland or maybe Poland or St […]
- 2023
- A Public Domain Face Only Alamy Could Love Ain’t that llama a cutie? What is that smile about? Ah, it’s how this person (a.k.a..me) can stand the fact that someone is making money off of a photo I took and shared on the internets. Doesn’t a license protect me? Welcome to my unconventional corner of the Creative Commons tent, already explained in 2016: […]
- Humanery and/or Machinery Despite the apparent demise of blogs the flat line of the RSS-ograph blips with a pulse from David Kernohan “on chatbots.” FOTA is alive! Unsure if my comment gets through the gate (a first one generated a critical WordPress error, sorry, David), but I have to at least assert my assertion, as if it blips […]
- 2016
- 2014
- 50+ Web Ways to Tell a Story Done One New Way cc licensed ( BY SA ) flickr photo shared by Alan Levine My second day at Skidmore College this week was set to do a workshop; I offered to do a version of 50 Web Ways to Tell a Story planning to tap into for the first time the new collection of mobile apps I […]
- Making/Telling Stories That Matter (except for the Skidmore lacrosse fans) On Tuesday, everything was lined up smooth for my invited talk at Skidmore College, Making/Telling Stories That Matter (ironically I submitted that as a title before I knew that the Skidmore motto was “CTM” aka Creative Thought Matters) (honestly). Except that when the a/v crew went to turn on the livestream broadcast, they found it […]
- 2011
- The Web Story I am Not Doing While sanding my deck I am mulling over what I will do for the Web Story assignment in ds106. I have my target and plan in mind, and hope to hatch it over the next day or two. An idea I had discarded as pointless was doing one on Wikipedia- pointless because one can already […]
- 2009
- CitiBank Has a Solution to the Bank Crises cc licensed flickr photo by Miicha A. Ponce Between gorging on the tax payer supplied bailout, Citibank is going to even things out by gouging and sticking it to their own customers. I just found out that I contributed to their cause, without being aware of it. Back in October 2008, I decided to close […]
- 2008
- 2007
- nag nag posted 24 Mar ’06, 3.02pm MST PST on flickr Dorset how I love being one Share this barking on social media
- No Net, No Cry Today’s Office posted 20 Mar ’07, 4.36pm MDT PST on flickr Right in the middle of IM-ing, checking a streaming audio connection in Second Life, my internet connection blinked out. Qwest said, "There are outages on your area" and with an estimated fix time of "a few hours", I trucked down to the Scottsdale Public […]
- 2005
- A First? Podcasting in an ePortfolio System I just noted that podcasts are screaming up the meme charts, and a day later some exciting news. Audree, who programs our eportfolio system available at Maricopa and her Chandler-Gilbert Community College has announced the upcoming availability of streaming media being built into the system (see latest ePortfolio enhancements, nicely published in an eport): The […]
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 March 20th
- 2024
- Stop (I hope) Logging in to that Old WordPress Site In the spirit of Tom’s short tech notes to oneself… I archived a WordPress site I made a few years back for Cori’s high schools students to do some (anonymous) online writing. The site is really just to keep as an archive (and honestly it would be better to convert to static HTML, put that […] ➡
- Redoing the Unfamiliar Familiar Somewhere out there a man in Iceland will smile. I’ve never met, known, or contacted him, but from a Mastodon repost by Joe Murphy, Baldour wrote delightfully about a precious (in terms of value) habit that made me smile: Somewhere this blog may light up an RSS reader in Iceland or maybe Poland or St […] ➡
- 2023
- A Public Domain Face Only Alamy Could Love Ain’t that llama a cutie? What is that smile about? Ah, it’s how this person (a.k.a..me) can stand the fact that someone is making money off of a photo I took and shared on the internets. Doesn’t a license protect me? Welcome to my unconventional corner of the Creative Commons tent, already explained in 2016: […] ➡
- Humanery and/or Machinery Despite the apparent demise of blogs the flat line of the RSS-ograph blips with a pulse from David Kernohan “on chatbots.” FOTA is alive! Unsure if my comment gets through the gate (a first one generated a critical WordPress error, sorry, David), but I have to at least assert my assertion, as if it blips […] ➡
- 2016
- 2014
- 50+ Web Ways to Tell a Story Done One New Way cc licensed ( BY SA ) flickr photo shared by Alan Levine My second day at Skidmore College this week was set to do a workshop; I offered to do a version of 50 Web Ways to Tell a Story planning to tap into for the first time the new collection of mobile apps I […] ➡
- Making/Telling Stories That Matter (except for the Skidmore lacrosse fans) On Tuesday, everything was lined up smooth for my invited talk at Skidmore College, Making/Telling Stories That Matter (ironically I submitted that as a title before I knew that the Skidmore motto was “CTM” aka Creative Thought Matters) (honestly). Except that when the a/v crew went to turn on the livestream broadcast, they found it […] ➡
- 2011
- The Web Story I am Not Doing While sanding my deck I am mulling over what I will do for the Web Story assignment in ds106. I have my target and plan in mind, and hope to hatch it over the next day or two. An idea I had discarded as pointless was doing one on Wikipedia- pointless because one can already […] ➡
- 2009
- CitiBank Has a Solution to the Bank Crises cc licensed flickr photo by Miicha A. Ponce Between gorging on the tax payer supplied bailout, Citibank is going to even things out by gouging and sticking it to their own customers. I just found out that I contributed to their cause, without being aware of it. Back in October 2008, I decided to close […] ➡
- 2008
- 2007
- nag nag posted 24 Mar ’06, 3.02pm MST PST on flickr Dorset how I love being one Share this barking on social media ➡
- No Net, No Cry Today’s Office posted 20 Mar ’07, 4.36pm MDT PST on flickr Right in the middle of IM-ing, checking a streaming audio connection in Second Life, my internet connection blinked out. Qwest said, "There are outages on your area" and with an estimated fix time of "a few hours", I trucked down to the Scottsdale Public […] ➡
- 2005
- A First? Podcasting in an ePortfolio System I just noted that podcasts are screaming up the meme charts, and a day later some exciting news. Audree, who programs our eportfolio system available at Maricopa and her Chandler-Gilbert Community College has announced the upcoming availability of streaming media being built into the system (see latest ePortfolio enhancements, nicely published in an eport): The […] ➡
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.