“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 9 posts previously published on April 25th
- 2012
- And Now, For the Rest of the Archiving Continuing from Monday’s start on archiving and semester wrapping up. Schedule your final meeting (Monday – through Friday; 4/30- 5/4) via http://tungle.me/cogdog Complete class evaluations (in your email, came from Taiwo Ande) See full details on archiving, mapping domains, and migrating In class- export a snapshot of your blog Tools–>Export Later – import this data […]
- 2011
- Blowing Up Yer Blogs on ds106.tv There was no reason for this besides an opportunity to go over the top Watch live video from ds106tv on Justin.tv (Consider yourself fortunate if you do NOT get the mustard ad…..) Some Jim had to annihilate his network, I could not help but obey the force of mockery and go out and TNT some […]
- Unique… But Not *That* Unique This morning I got to be a part of the EDUCAUSE Mobile Sprint, a five day, webinar-based event focused on mobile technology. When they first approached me with words like “keynote” / “presentation”, I declined as I have a huge amount of prep for events end of this week and next. Plus, I am no […]
- 20/20 Cloud (H)in(d)sight cc licensed ( BY NC ND ) flickr photo shared by fs999 There is a tad bit of smugness of people dissing the cloud after last week’s Amazon EC2 #fail. I respect you a lot Doug, but on reading this: Having recently considered moving this blog to Amazon EC2 because it’s “˜never down’ I breathed […]
- 2010
- I’m an Unconsumer cc licensed flickr photo shared by cogdogblog From an information source outside my normal education and technology readings, Shareable is a real gem– Shareable is a nonprofit online magazine that tells the story of sharing. We cover the people, places, and projects that are bringing a shareable world to life. And we share tools and […]
- Done Pile cc licensed flickr photo shared by ex_magician Wow, does anyone remember 43 Things? It was one of the early social networking apps, and to me, still a nifty idea. You list 43 things you want to do, it connects you with other people who have the same goal or have completed it. You can post […]
- 2008
- Asking the Google-able Yes, we know that Google has become the appliance of the web. If it were to go out, it would be on the scale (well not really) of losing electric or water. And while some may bemoan that students’ first thought to research is to Google-it, I find myself curious that often people ask me […]
- 50 Ways Seeks 150 Examples I am rather overwhelmed and honored when people tell me how they use, refer or just like the 50 Ways to Tell a Web 2.0 Story (heck I just found out the Andy Carvin blogged it with some nice words way back in November at PBS). It was just a half crazy idea that has […]
- 2004
- Pat and the Official Blog Welcome Maybe minutes after mentioning I was in San Francisco for a Pachyderm meeting, I was contacted via em-mail and then iChat by Pat Delaney who offered to meet up and show me the sites off the tourist beaten track. This was great,a s was hearing some of Pat’s work at Gallileo High School, the Bay […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 9 posts previously published on April 25th
- 2012
- And Now, For the Rest of the Archiving Continuing from Monday’s start on archiving and semester wrapping up. Schedule your final meeting (Monday – through Friday; 4/30- 5/4) via http://tungle.me/cogdog Complete class evaluations (in your email, came from Taiwo Ande) See full details on archiving, mapping domains, and migrating In class- export a snapshot of your blog Tools–>Export Later – import this data […] ➡
- 2011
- Blowing Up Yer Blogs on ds106.tv There was no reason for this besides an opportunity to go over the top Watch live video from ds106tv on Justin.tv (Consider yourself fortunate if you do NOT get the mustard ad…..) Some Jim had to annihilate his network, I could not help but obey the force of mockery and go out and TNT some […] ➡
- Unique… But Not *That* Unique This morning I got to be a part of the EDUCAUSE Mobile Sprint, a five day, webinar-based event focused on mobile technology. When they first approached me with words like “keynote” / “presentation”, I declined as I have a huge amount of prep for events end of this week and next. Plus, I am no […] ➡
- 20/20 Cloud (H)in(d)sight cc licensed ( BY NC ND ) flickr photo shared by fs999 There is a tad bit of smugness of people dissing the cloud after last week’s Amazon EC2 #fail. I respect you a lot Doug, but on reading this: Having recently considered moving this blog to Amazon EC2 because it’s “˜never down’ I breathed […] ➡
- 2010
- I’m an Unconsumer cc licensed flickr photo shared by cogdogblog From an information source outside my normal education and technology readings, Shareable is a real gem– Shareable is a nonprofit online magazine that tells the story of sharing. We cover the people, places, and projects that are bringing a shareable world to life. And we share tools and […] ➡
- Done Pile cc licensed flickr photo shared by ex_magician Wow, does anyone remember 43 Things? It was one of the early social networking apps, and to me, still a nifty idea. You list 43 things you want to do, it connects you with other people who have the same goal or have completed it. You can post […] ➡
- 2008
- Asking the Google-able Yes, we know that Google has become the appliance of the web. If it were to go out, it would be on the scale (well not really) of losing electric or water. And while some may bemoan that students’ first thought to research is to Google-it, I find myself curious that often people ask me […] ➡
- 50 Ways Seeks 150 Examples I am rather overwhelmed and honored when people tell me how they use, refer or just like the 50 Ways to Tell a Web 2.0 Story (heck I just found out the Andy Carvin blogged it with some nice words way back in November at PBS). It was just a half crazy idea that has […] ➡
- 2004
- Pat and the Official Blog Welcome Maybe minutes after mentioning I was in San Francisco for a Pachyderm meeting, I was contacted via em-mail and then iChat by Pat Delaney who offered to meet up and show me the sites off the tourist beaten track. This was great,a s was hearing some of Pat’s work at Gallileo High School, the Bay […] ➡
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.