“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 12 posts previously published on May 18th
- 2018
- The #ResNetSem Fab Four Meet the four newest MA Thesis Writing Studies graduates from Kean University. They are indeed fab, and I’m proud of their accomplishments. How I, an ed-tech WordPress bending media playing geek with an MS in Geology came to be running a thesis seminar in New Jersey from home on Arizona, is a long story. It […]
- 2017
- On Annotating Recipes I baked banana bread tonight; I am eating warm slice of it right now. Big deal, eh? A year ago I could not say this. One day I saw again the pile of brown bananas I had let linger on the counter too long. In a surprise move, I googled “banana bread recipe”. There’s only […]
- 2016
- The Periodic Table of Stupid Periodic Tables Look, I’m no chemist. I did standard chemistry classes as an undergraduate students, and delved in through my major in Geology (what do you think rocks are made of?), courses in Geochemistry, did I take PChem? What I do remember is my 10th grade Chemistry teacher, Blooma Friedman, would not put up with any scientific […]
- Ten Years Since ELI Fish Tacos Twas just some silly banter in twitter that got me looking for an image I had created for a presentation at an EDUCAUSE ELI conference. And thus I found myself flipping through a set of remix style book covers I had made back in 2006, a full half decade prior to find a course/cult named […]
- 2014
- When the course is over… Yeah, c’mon When the course is over When the course is over, yeah When the course is over Keep on the blogs Keep on the blogs Keep on the blogs, yeah For the blog is your special friend Keep on feeding as it intends Blog is your only friend Until the end Until the end […]
- 2013
- Train Keeps a Rolling in Wide Open Spaces Blogging to you from the outskirts of Vegas…. Las Vegas New Mexico. A guy just got off the train there just for the enchiladas. I cannot fully explain why I feel at home, reassured by these vast open spaces of rock and scrub brush and sky. I overhear the passengers from New Jersey and Florida […]
- 2011
- Jim Groom and ds106 Radio There are as many stories of openness about ds106 (http://ds106.us), the open course on digital storytelling, as there are stars in the sky. But Jim Grom shares what may be the most unexpected outcome of a class- a web-based free form radio station that emerged from the community, and is now, as he says, "a […]
- 2010
- Have a Blast on Your Birthday WikiMedia Commons photo posted by Donald Swanson I caught the NPR story on the radio this morning that today was the 30th year since the major volcanic eruption at Mount St. Helens (what do you buy a volcano on its birthday, and technically, no not really its birthday). What was I doing May 18, 1980? […]
- 2008
- 24 Hours in the Woods TentCam Originally uploaded by cogdogblog Back in the day when I was a free wheeling no responsibility grad student herein Arizona, I spent a lot of time doing solo backpack trips, especially out in the Superstition Wilderness Area and up on the Mogollon Rim. It sure seemed time to get back to nature, and my […]
- 2007
- Badge of Honor Badge of Honor posted 17 May ’07, 9.45pm MDT PST on flickr You have no idea how much honor there was in being a part of Faculty Academy Sitting in the Richmond airport, sipping the free wifi on my way home to Phoenix, I am still swimming in the euphoric high of having the honor […]
- 2005
- Road Dog This dog will be going to low blog mode for the next week or so. First up is some time off to visit Mom in Florida. On May 23-24 I get to be a guest presenter at a faculty workshop at San Diego State University, invited by Bernie Dodge, the genius creator of WebQuests and […]
- 2004
- Ocotillo Retreat Today Today is my big catered affair. The 2004 Ocotillo Retreatis the 17th one for the Maricopa Community College’s “Ocotillo” program— something started to provide a faculty-led focus on issues of instructional technology. Ocotillo is a desert plant that is also the creative metaphor for what has been a dynamic and evolving organization over the years […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 12 posts previously published on May 18th
- 2018
- The #ResNetSem Fab Four Meet the four newest MA Thesis Writing Studies graduates from Kean University. They are indeed fab, and I’m proud of their accomplishments. How I, an ed-tech WordPress bending media playing geek with an MS in Geology came to be running a thesis seminar in New Jersey from home on Arizona, is a long story. It […] ➡
- 2017
- On Annotating Recipes I baked banana bread tonight; I am eating warm slice of it right now. Big deal, eh? A year ago I could not say this. One day I saw again the pile of brown bananas I had let linger on the counter too long. In a surprise move, I googled “banana bread recipe”. There’s only […] ➡
- 2016
- The Periodic Table of Stupid Periodic Tables Look, I’m no chemist. I did standard chemistry classes as an undergraduate students, and delved in through my major in Geology (what do you think rocks are made of?), courses in Geochemistry, did I take PChem? What I do remember is my 10th grade Chemistry teacher, Blooma Friedman, would not put up with any scientific […] ➡
- Ten Years Since ELI Fish Tacos Twas just some silly banter in twitter that got me looking for an image I had created for a presentation at an EDUCAUSE ELI conference. And thus I found myself flipping through a set of remix style book covers I had made back in 2006, a full half decade prior to find a course/cult named […] ➡
- 2014
- When the course is over… Yeah, c’mon When the course is over When the course is over, yeah When the course is over Keep on the blogs Keep on the blogs Keep on the blogs, yeah For the blog is your special friend Keep on feeding as it intends Blog is your only friend Until the end Until the end […] ➡
- 2013
- Train Keeps a Rolling in Wide Open Spaces Blogging to you from the outskirts of Vegas…. Las Vegas New Mexico. A guy just got off the train there just for the enchiladas. I cannot fully explain why I feel at home, reassured by these vast open spaces of rock and scrub brush and sky. I overhear the passengers from New Jersey and Florida […] ➡
- 2011
- Jim Groom and ds106 Radio There are as many stories of openness about ds106 (http://ds106.us), the open course on digital storytelling, as there are stars in the sky. But Jim Grom shares what may be the most unexpected outcome of a class- a web-based free form radio station that emerged from the community, and is now, as he says, "a […] ➡
- 2010
- Have a Blast on Your Birthday WikiMedia Commons photo posted by Donald Swanson I caught the NPR story on the radio this morning that today was the 30th year since the major volcanic eruption at Mount St. Helens (what do you buy a volcano on its birthday, and technically, no not really its birthday). What was I doing May 18, 1980? […] ➡
- 2008
- 24 Hours in the Woods TentCam Originally uploaded by cogdogblog Back in the day when I was a free wheeling no responsibility grad student herein Arizona, I spent a lot of time doing solo backpack trips, especially out in the Superstition Wilderness Area and up on the Mogollon Rim. It sure seemed time to get back to nature, and my […] ➡
- 2007
- Badge of Honor Badge of Honor posted 17 May ’07, 9.45pm MDT PST on flickr You have no idea how much honor there was in being a part of Faculty Academy Sitting in the Richmond airport, sipping the free wifi on my way home to Phoenix, I am still swimming in the euphoric high of having the honor […] ➡
- 2005
- Road Dog This dog will be going to low blog mode for the next week or so. First up is some time off to visit Mom in Florida. On May 23-24 I get to be a guest presenter at a faculty workshop at San Diego State University, invited by Bernie Dodge, the genius creator of WebQuests and […] ➡
- 2004
- Ocotillo Retreat Today Today is my big catered affair. The 2004 Ocotillo Retreatis the 17th one for the Maricopa Community College’s “Ocotillo” program— something started to provide a faculty-led focus on issues of instructional technology. Ocotillo is a desert plant that is also the creative metaphor for what has been a dynamic and evolving organization over the years […] ➡
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.