“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 14 posts previously published on April 12th
- 2021
- It’s the Picture of Reusable Open Content I bristle slightly when I reads something that seems to conflate Open Textbooks and Open Educational Resources (OER). Only slightly. The success of open textbooks, not only for what they are providing and creating benefits to students, is that it finally is something the wider swath of academia has awakened to. So the bristling matters […]
- 2018
- We Fit A break in the usual technical gobbledygook and assorted rantings for a not so small personal announcement… As a matter of fact, it’s as big as life… Cori did say “yes” If there is any doubt to the question, it’s one of marriage. Something I had vowed 10 years ago to never do again. I’m […]
- 2016
- How The #Western106 Was … Crumpled? Like a classic MOOC dropout artist, I’ve fallen so far off of my #western106 horse I can’t even see the dust any more. I had grand hopes of running a DS106 in a genre of Western films/stories. I was doing trailers back in October for a planned online class to teaching at Kansas State University, […]
- 2015
- Flickr CC Attribution Tool Is That Much More Fun Not long ago Flickr added two more options for published photos choosing creative commons licenses, both CC0 and a Public Domain. This is a good thing, even if to me it adds more confusion as to which Public Domain license (both are PD licenses with differences perhaps requiring close readings with a lawyer) one might […]
- 2013
- Ãnægju og sársauka, einfaldar hugmyndir fyrir krikkets You should be confused. Today was a ds106 daily create monstrosity I can take responsibility for, and is one that busts my usual mantra of “things that you can create in 20 minutes”. Today’s assignment: Lipdub a video of yourself in another language talking seriously about crickets. Write the script and record the video. Then […]
- 2011
- 106 Photos Like us canines hearing sounds beyond the human spectrum, participants in ds106 seem to see lights and colors others miss… cc licensed ( BY ) flickr photo shared by cogdogblog This photo that was from a number light pole in Mesa, AZ, was the genesis for the Illustrate 106 visual assignment. I’ve dodged in and […]
- Dog Authors cc licensed ( BY ) flickr photo shared by cogdogblog Last November I had an ambition to do another round of NaNoWrimo but fell off the wagon early. It began as an experiment to do the writing in the open— which was fun, but then, alas,, the story part eluded me. My plan was to […]
- 2008
- Assorted Beach Observations Beach Scavengers by cogdogblog posted 12 Apr ’08, 10.12pm MDT PST on flickr Here on Sanibel Island these bent old white pasty birds work up and down the beach, bent over, constantly poking in the sand, picking up shells, filling up plastic bags, cups, upturned shirts. The booty is stuffed into suitcases, bags, wasting air […]
- 2007
- I Was Doing Ruby in the Mid 1990s I really do not want to learn a new web programming language. In my first round, through the late 1990s, it was perl, than I made the jump to doing my web stuff in PHP. Now of course, the rage and sexy code is done in Ruby — any slick new web site that moves […]
- 2006
- Podless Surrealism I’ve been using my iPod shuffle for exercising and playing through my car stereo (Transpod FM transmitter) for almost a year now. I’ve only listened to radio under duress or forgetfulness. But the last few weeks, I’ve left the pod home and re-inserted some CDs. This is only because I am trying to sell the […]
- Online Community Megalopoli You can never have too much online community building (activity), but do you wonder about how many online community places there will be? Liking going from a nice scattering of small rural communities to big bustling cities, are we headed down the road to sprawling Megalopoli. I am criticizing none of these efforts, nor their […]
- 2005
- Blackboard Discovers Blogs (but not where you think) Hey! Have you heard about this new cool thing called “blogging“? Well, shucks, it looks like the folks down at Blackboard central have stumbled on to it! Innovation! Yup, with all the expertise and license bucks piled up down there, they have set up “The Blackboard Weblog” at … Blogger.com? http://www.blackboardblog.blogspot.com/ And all those Bbig […]
- BikeRidePodCast I’m tuning into some podcasts, finally. Today on my 11 mile bicycle commute (something I need to get back to doing regularly), I carried my iRiver in my pocket and listened to Rael Dornfest – Rules for Remixing, a session from the ETech Conference. It made for a nice ride in. My only flub was […]
- 2004
- Coming To a Browser Near You: 2 Presentations on PhotoBlogging I have two presentations looming for the April 20-22 Teaching in the Community Colleges 2004 Online Conference, both related to creating online content out of primarily digital images. The wraps are still up, the ink is wet, and the typos run freely, but it is falling into place nicely. I am fishing for some folks […]
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 April 12th
- 2021
- It’s the Picture of Reusable Open Content I bristle slightly when I reads something that seems to conflate Open Textbooks and Open Educational Resources (OER). Only slightly. The success of open textbooks, not only for what they are providing and creating benefits to students, is that it finally is something the wider swath of academia has awakened to. So the bristling matters […] ➡
- 2018
- We Fit A break in the usual technical gobbledygook and assorted rantings for a not so small personal announcement… As a matter of fact, it’s as big as life… Cori did say “yes” If there is any doubt to the question, it’s one of marriage. Something I had vowed 10 years ago to never do again. I’m […] ➡
- 2016
- How The #Western106 Was … Crumpled? Like a classic MOOC dropout artist, I’ve fallen so far off of my #western106 horse I can’t even see the dust any more. I had grand hopes of running a DS106 in a genre of Western films/stories. I was doing trailers back in October for a planned online class to teaching at Kansas State University, […] ➡
- 2015
- Flickr CC Attribution Tool Is That Much More Fun Not long ago Flickr added two more options for published photos choosing creative commons licenses, both CC0 and a Public Domain. This is a good thing, even if to me it adds more confusion as to which Public Domain license (both are PD licenses with differences perhaps requiring close readings with a lawyer) one might […] ➡
- 2013
- Ãnægju og sársauka, einfaldar hugmyndir fyrir krikkets You should be confused. Today was a ds106 daily create monstrosity I can take responsibility for, and is one that busts my usual mantra of “things that you can create in 20 minutes”. Today’s assignment: Lipdub a video of yourself in another language talking seriously about crickets. Write the script and record the video. Then […] ➡
- 2011
- 106 Photos Like us canines hearing sounds beyond the human spectrum, participants in ds106 seem to see lights and colors others miss… cc licensed ( BY ) flickr photo shared by cogdogblog This photo that was from a number light pole in Mesa, AZ, was the genesis for the Illustrate 106 visual assignment. I’ve dodged in and […] ➡
- Dog Authors cc licensed ( BY ) flickr photo shared by cogdogblog Last November I had an ambition to do another round of NaNoWrimo but fell off the wagon early. It began as an experiment to do the writing in the open— which was fun, but then, alas,, the story part eluded me. My plan was to […] ➡
- 2008
- Assorted Beach Observations Beach Scavengers by cogdogblog posted 12 Apr ’08, 10.12pm MDT PST on flickr Here on Sanibel Island these bent old white pasty birds work up and down the beach, bent over, constantly poking in the sand, picking up shells, filling up plastic bags, cups, upturned shirts. The booty is stuffed into suitcases, bags, wasting air […] ➡
- 2007
- I Was Doing Ruby in the Mid 1990s I really do not want to learn a new web programming language. In my first round, through the late 1990s, it was perl, than I made the jump to doing my web stuff in PHP. Now of course, the rage and sexy code is done in Ruby — any slick new web site that moves […] ➡
- 2006
- Podless Surrealism I’ve been using my iPod shuffle for exercising and playing through my car stereo (Transpod FM transmitter) for almost a year now. I’ve only listened to radio under duress or forgetfulness. But the last few weeks, I’ve left the pod home and re-inserted some CDs. This is only because I am trying to sell the […] ➡
- Online Community Megalopoli You can never have too much online community building (activity), but do you wonder about how many online community places there will be? Liking going from a nice scattering of small rural communities to big bustling cities, are we headed down the road to sprawling Megalopoli. I am criticizing none of these efforts, nor their […] ➡
- 2005
- Blackboard Discovers Blogs (but not where you think) Hey! Have you heard about this new cool thing called “blogging“? Well, shucks, it looks like the folks down at Blackboard central have stumbled on to it! Innovation! Yup, with all the expertise and license bucks piled up down there, they have set up “The Blackboard Weblog” at … Blogger.com? http://www.blackboardblog.blogspot.com/ And all those Bbig […] ➡
- BikeRidePodCast I’m tuning into some podcasts, finally. Today on my 11 mile bicycle commute (something I need to get back to doing regularly), I carried my iRiver in my pocket and listened to Rael Dornfest – Rules for Remixing, a session from the ETech Conference. It made for a nice ride in. My only flub was […] ➡
- 2004
- Coming To a Browser Near You: 2 Presentations on PhotoBlogging I have two presentations looming for the April 20-22 Teaching in the Community Colleges 2004 Online Conference, both related to creating online content out of primarily digital images. The wraps are still up, the ink is wet, and the typos run freely, but it is falling into place nicely. I am fishing for some folks […] ➡
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.