“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 September 20th
- 2022
- Hello, Blog Hey CogDogBlog, you seem to be devoid of not only a hello world, but not too many posts at all recently. So never going out of style (here) is the genre of Blogging about Not Blogging closely followed up by Blogging about Blogging (2007 version! 2010 version!) (and a cover song “Where Have All the […]
- 2016
- Not Your Mothers Father of Distance Education Tony Bates recently posted Who are the founding fathers of distance education? following the release of a Steve Wheeler produced video interview with Tony and other identified “fathers” Michael Moore and Sir John Daniel. As he is, Tony humbly downplays his role, and lists five other suggestions in his post, inviting others to add comment […]
- Twitter Avatars Downloaded Over Easy I should have known better. It was just 2 hours (plus blog post writing time) down the coding rabbit hole. Right now Ken Bauer is working on the Virtually Connecting blog post for the sessions they (me too) will run at the 2016 DML Conference. If you look at the announcements you will we create […]
- 2014
- Farewell Cadu creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog I got the sad news today from my ex that Cadu has left this earth. This loyal black lab was the sister of Mickey, the brown lab who stands in for me on my various avatars and this web site banner. We got both […]
- 2011
- How to Be a Social Media Dust Bunny* cc licensed ( BY NC ND ) flickr photo shared by mr. nightshade Scott Leslie once pined for a conference badge sensor that would light up when a Dust Bunny is in the vicinity. I am sure with some hacking and Arduino skills, this is certainly possible. But then again, Social Media Dust Bunnies look […]
- On Kamping I hate to come off as an outdoor snob, but on my trip, what many people describe as “camping” is pulling some giant metal box into a parking lot, unrolling the satellite dish, and sleeping inside. At the campground at Glacier National park, a giant ‘bago rolled in, the lights went on, and no one […]
- Beyond Forever Ago cc licensed ( BY ) flickr photo shared by cogdogblog To add to the mix of opening ds106 salvos, inspired by Michael B Smith, Cheryl Colan, and Lou McGill, that was my somewhere near the end of high school. I found it at my Mom’s house; she had a 1982 date written on the back, […]
- 2008
- Shanghaid What a Dumpling by cogdogblog posted 20 Sep ’08, 8.09pm MDT PST on flickr Just one piece of dinner at at JC’s restaurant in Shanghai It’s been a whirlwind week for my first visit to Shanghai (an Asia while I am at it) to participate and speak at the Learning 2.008 Conference at the Shanghai […]
- 2006
- Google Home Tabs I’ve had the personalized Google home page set on all my browsers for a while, but just recently noticed that you can now add tabs to organize and spread out the different tools and feeds you can use. So I gleaned a few off the front view, leaving my flickr wallet,Gmail inbox, delicious tagged sites, […]
- Blog Fandom Fed This has been quite a few days… I’ve been in Newark, NJ, for a meeting related to NMC’s project on MacArthur Foundation Series Digital Media (no link, a rather long, un-bloggable story there), but it has been a momentous gathering of top names in the many fields. There are 90 some expert authors and editors […]
- 2005
- Finding Pod/Vidcasts in Loomia (Ups and Downs of Tags) Interesting site in a quick flyby: Loomia is a search and tag site for audio and video “casts”: As more and more audio and video makes their way to the Internet, it has become increasingly difficult to find things that you like. Loomia is a podcast and videocast search engine plus much more. Our goal […]
- Podcast for My Auto Mechanic My 1995 Nissan pickup has 125,000 miles under its wheels and I’d like to see more flip by. For sometime we’ve been hearing this occasional squeak/squeal coming from either the belts or the wheels, it is intermittent and hard to associate with specific events. We’ve asked our mechanic to check it out, trying to describe […]
- NetNewsWire- What Does This Button Do? For some reason this morning, NetNewsWire Lite (my desktop OS X RSS reader) was slow in updating the feeds, so I started poking around the interface. In the bottom left I noticed a small double arrow control labeled “default”, and I thought… “what does this do?”: Why it’s a menu! What does it do?: It’s […]
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 20th
- 2022
- Hello, Blog Hey CogDogBlog, you seem to be devoid of not only a hello world, but not too many posts at all recently. So never going out of style (here) is the genre of Blogging about Not Blogging closely followed up by Blogging about Blogging (2007 version! 2010 version!) (and a cover song “Where Have All the […] ➡
- 2016
- Not Your Mothers Father of Distance Education Tony Bates recently posted Who are the founding fathers of distance education? following the release of a Steve Wheeler produced video interview with Tony and other identified “fathers” Michael Moore and Sir John Daniel. As he is, Tony humbly downplays his role, and lists five other suggestions in his post, inviting others to add comment […] ➡
- Twitter Avatars Downloaded Over Easy I should have known better. It was just 2 hours (plus blog post writing time) down the coding rabbit hole. Right now Ken Bauer is working on the Virtually Connecting blog post for the sessions they (me too) will run at the 2016 DML Conference. If you look at the announcements you will we create […] ➡
- 2014
- Farewell Cadu creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog I got the sad news today from my ex that Cadu has left this earth. This loyal black lab was the sister of Mickey, the brown lab who stands in for me on my various avatars and this web site banner. We got both […] ➡
- 2011
- How to Be a Social Media Dust Bunny* cc licensed ( BY NC ND ) flickr photo shared by mr. nightshade Scott Leslie once pined for a conference badge sensor that would light up when a Dust Bunny is in the vicinity. I am sure with some hacking and Arduino skills, this is certainly possible. But then again, Social Media Dust Bunnies look […] ➡
- On Kamping I hate to come off as an outdoor snob, but on my trip, what many people describe as “camping” is pulling some giant metal box into a parking lot, unrolling the satellite dish, and sleeping inside. At the campground at Glacier National park, a giant ‘bago rolled in, the lights went on, and no one […] ➡
- Beyond Forever Ago cc licensed ( BY ) flickr photo shared by cogdogblog To add to the mix of opening ds106 salvos, inspired by Michael B Smith, Cheryl Colan, and Lou McGill, that was my somewhere near the end of high school. I found it at my Mom’s house; she had a 1982 date written on the back, […] ➡
- 2008
- Shanghaid What a Dumpling by cogdogblog posted 20 Sep ’08, 8.09pm MDT PST on flickr Just one piece of dinner at at JC’s restaurant in Shanghai It’s been a whirlwind week for my first visit to Shanghai (an Asia while I am at it) to participate and speak at the Learning 2.008 Conference at the Shanghai […] ➡
- 2006
- Google Home Tabs I’ve had the personalized Google home page set on all my browsers for a while, but just recently noticed that you can now add tabs to organize and spread out the different tools and feeds you can use. So I gleaned a few off the front view, leaving my flickr wallet,Gmail inbox, delicious tagged sites, […] ➡
- Blog Fandom Fed This has been quite a few days… I’ve been in Newark, NJ, for a meeting related to NMC’s project on MacArthur Foundation Series Digital Media (no link, a rather long, un-bloggable story there), but it has been a momentous gathering of top names in the many fields. There are 90 some expert authors and editors […] ➡
- 2005
- Finding Pod/Vidcasts in Loomia (Ups and Downs of Tags) Interesting site in a quick flyby: Loomia is a search and tag site for audio and video “casts”: As more and more audio and video makes their way to the Internet, it has become increasingly difficult to find things that you like. Loomia is a podcast and videocast search engine plus much more. Our goal […] ➡
- Podcast for My Auto Mechanic My 1995 Nissan pickup has 125,000 miles under its wheels and I’d like to see more flip by. For sometime we’ve been hearing this occasional squeak/squeal coming from either the belts or the wheels, it is intermittent and hard to associate with specific events. We’ve asked our mechanic to check it out, trying to describe […] ➡
- NetNewsWire- What Does This Button Do? For some reason this morning, NetNewsWire Lite (my desktop OS X RSS reader) was slow in updating the feeds, so I started poking around the interface. In the bottom left I noticed a small double arrow control labeled “default”, and I thought… “what does this do?”: Why it’s a menu! What does it do?: It’s […] ➡
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.
Share this barking on social media