“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 17 posts previously published on August 31st
- 2022
- Branching into H5P Texas Style Not in the spirit of slow blogging, this is just a slow blogger, catching up on a presentation done back on July 12. When I was a kid blogger, I’d have it written before the end of the day. C’est la blog. I do relish (possible pun warning) an opportunity to tap back into the […]
- 2020
- Finally! Easier Updating for WordPress Uploaded Themes It’s about time. Thank you, WordPress version 5.5. A subtle new feature appeared, I only glanced after running the update on one of my sites. Those themes you install directly from WordPress have long been easy to update, it’s done in one click (and now can be set to autoupdate). But for themes you upload […]
- 2018
- At the End of My Summer of Ontario Extend The beaches have emptied, the life guards off duty back to their “real jobs”, and I’m just the lone guy on the shore walking around with a metal detector. Today marks the end of my stint sitting in for Terry Greene in facilitating what I could for the eCampus Ontario Extend project. This is what’s […]
- 2015
- In Which I Realize I’m in the Middle of a Learning Project It dawned on me yesterday that my forays into recording and sharing my own covers of songs was actually the kind of thing Dean Shareski coined in 2011 as a Learning Project: I’m asking my students to take 25-50 hours and learn something new. While Ewan’s goals were somewhat different, I want my students to […]
- Amy Burvall Delivers not one but TEN (count ’em) Stories of Connection I do not think Feldspar is going to hear any wailing from me for a while… In her typical “never do anything the easy way” Amy Burvall delivered me a lavishly animated (all the colors- black, pink, AND white) video of not just a story of connection, but ten of them: She’s got everything from […]
- 2013
- Tweaking Theme Since the last post, I have started the theme tinkering with this blog that is part of the first week of headless ds106 I just fished around the themes on wordpress.org you get to right inside the dashboard (Appearance — Themes — Install). I checked the option to show themes related to photoblogging, and took […]
- 2011
- Why I Blog About Me (I found another old post, hey is running this blog?) Note- this is 1000% snarky satire. Place your sarcasm sensors on high…. I typically include pictures of myself in my blog posts. Why? Well doesn’t it explain itself? Why just look at me. I just love looking at me so much, its quite natural the […]
- Love Numbers? (I found this old post in my drafts, I guess I never clicked “publish”) I already tweeted this site, but the more I thought about how beautiful and fun it makes numbers, I wanted to share some more. Number Gossip is simple, and elegant, and makes it purpose clear: Enter a number and I’ll tell […]
- What Radio Does cc licensed ( BY NC ND ) flickr photo shared by The Rocketeer A number of things these days I find interesting are ones where you say “I can try and explain but you really had to be there” This includes they way people have described the Unplug’d conference (I’ve met like half on my […]
- 2009
- Updating Web Sites with Google Spreadsheets I’ve done a handful of web projects this year where it made sense to store data in Google Spreadsheets, and then use a bit of PHP code to make them be dynamically displayed on a web site. In many cases, these are tables of data that are parsed and presented nicely in the web site, […]
- 2008
- What I Did 7AM on Holiday Weekend On the Couches for Learning 2.008 by cogdogblog posted 31 Aug ’08, 9.04am MDT PST on flickr Just finished an early morning (for me, others in Asia it was evening) pre-conference session leading up to the Learning 2.008 Conference in Shanghai- I was a guest along with David Warlick whom I have to go all […]
- 2005
- 5 for BlogDay Today is Blogday, celebrating an effort to push some folks in the long tail of the blog a little bit up the curve. BlogDay was initiated with the belief that bloggers should have one day which will be dedicated to know other bloggers, from other countries or areas of interests. In that day Bloggers will […]
- Lovely Design Quote This morning I was browsing the new Drupal fueled look to evolt, a web developer site I’ve been tapping into for so long I cannot remember, and started reading Isaac Forman’s Usable Forms (for an international audience). It’s a good review of some of the pitfalls in web forms when we are not thinking enough […]
- 2004
- Skyped? Skyping? I’ve not read much on Skype until I noticed via Joi Ito that a Mac version was out. Heck, I did not even know what it did! It appears to be a simple way to have audio conversations via the net, and even 3,4 way conversations. The trouble is I don’t have anyone to Skype […]
- Abandon IE Now In a world where human behavior is in accordance to PT Barnum’s laws, we all would be using Internet Explorer. I am afraid we live in that world. I waste more time trying to fix CSS problems in IE than I care for. Why cannot those Microsoft engineers build a browser that follows Web Standards? […]
- ASU Wiki Workshop Last night, my friend and colleague Tom Foster invited be as a “guest expert” (hah!) for a class he is teaching at Arizona State University, “Social and Ethical Issues in Educational Media”. The students were all K-12 teachers, librarians, and media specialists, and they had amazing, heroic energy for a group who had worked all […]
- The Sunday Triathalon In preparation for a mid September Grand Canyon trip, this past Sunday I completed the unofficial, unsanctioned CogDogBlog triathalon, which will not be covered on NBC or commented on by Bob Costas. The event included: A two mile mountain bike ride to Camelback Mountain A grueling ascent and descent of Camelback on the Cholla Trail […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 17 posts previously published on August 31st
- 2022
- Branching into H5P Texas Style Not in the spirit of slow blogging, this is just a slow blogger, catching up on a presentation done back on July 12. When I was a kid blogger, I’d have it written before the end of the day. C’est la blog. I do relish (possible pun warning) an opportunity to tap back into the […] ➡
- 2020
- Finally! Easier Updating for WordPress Uploaded Themes It’s about time. Thank you, WordPress version 5.5. A subtle new feature appeared, I only glanced after running the update on one of my sites. Those themes you install directly from WordPress have long been easy to update, it’s done in one click (and now can be set to autoupdate). But for themes you upload […] ➡
- 2018
- At the End of My Summer of Ontario Extend The beaches have emptied, the life guards off duty back to their “real jobs”, and I’m just the lone guy on the shore walking around with a metal detector. Today marks the end of my stint sitting in for Terry Greene in facilitating what I could for the eCampus Ontario Extend project. This is what’s […] ➡
- 2015
- In Which I Realize I’m in the Middle of a Learning Project It dawned on me yesterday that my forays into recording and sharing my own covers of songs was actually the kind of thing Dean Shareski coined in 2011 as a Learning Project: I’m asking my students to take 25-50 hours and learn something new. While Ewan’s goals were somewhat different, I want my students to […] ➡
- Amy Burvall Delivers not one but TEN (count ’em) Stories of Connection I do not think Feldspar is going to hear any wailing from me for a while… In her typical “never do anything the easy way” Amy Burvall delivered me a lavishly animated (all the colors- black, pink, AND white) video of not just a story of connection, but ten of them: She’s got everything from […] ➡
- 2013
- Tweaking Theme Since the last post, I have started the theme tinkering with this blog that is part of the first week of headless ds106 I just fished around the themes on wordpress.org you get to right inside the dashboard (Appearance — Themes — Install). I checked the option to show themes related to photoblogging, and took […] ➡
- 2011
- Why I Blog About Me (I found another old post, hey is running this blog?) Note- this is 1000% snarky satire. Place your sarcasm sensors on high…. I typically include pictures of myself in my blog posts. Why? Well doesn’t it explain itself? Why just look at me. I just love looking at me so much, its quite natural the […] ➡
- Love Numbers? (I found this old post in my drafts, I guess I never clicked “publish”) I already tweeted this site, but the more I thought about how beautiful and fun it makes numbers, I wanted to share some more. Number Gossip is simple, and elegant, and makes it purpose clear: Enter a number and I’ll tell […] ➡
- What Radio Does cc licensed ( BY NC ND ) flickr photo shared by The Rocketeer A number of things these days I find interesting are ones where you say “I can try and explain but you really had to be there” This includes they way people have described the Unplug’d conference (I’ve met like half on my […] ➡
- 2009
- Updating Web Sites with Google Spreadsheets I’ve done a handful of web projects this year where it made sense to store data in Google Spreadsheets, and then use a bit of PHP code to make them be dynamically displayed on a web site. In many cases, these are tables of data that are parsed and presented nicely in the web site, […] ➡
- 2008
- What I Did 7AM on Holiday Weekend On the Couches for Learning 2.008 by cogdogblog posted 31 Aug ’08, 9.04am MDT PST on flickr Just finished an early morning (for me, others in Asia it was evening) pre-conference session leading up to the Learning 2.008 Conference in Shanghai- I was a guest along with David Warlick whom I have to go all […] ➡
- 2005
- 5 for BlogDay Today is Blogday, celebrating an effort to push some folks in the long tail of the blog a little bit up the curve. BlogDay was initiated with the belief that bloggers should have one day which will be dedicated to know other bloggers, from other countries or areas of interests. In that day Bloggers will […] ➡
- Lovely Design Quote This morning I was browsing the new Drupal fueled look to evolt, a web developer site I’ve been tapping into for so long I cannot remember, and started reading Isaac Forman’s Usable Forms (for an international audience). It’s a good review of some of the pitfalls in web forms when we are not thinking enough […] ➡
- 2004
- Skyped? Skyping? I’ve not read much on Skype until I noticed via Joi Ito that a Mac version was out. Heck, I did not even know what it did! It appears to be a simple way to have audio conversations via the net, and even 3,4 way conversations. The trouble is I don’t have anyone to Skype […] ➡
- Abandon IE Now In a world where human behavior is in accordance to PT Barnum’s laws, we all would be using Internet Explorer. I am afraid we live in that world. I waste more time trying to fix CSS problems in IE than I care for. Why cannot those Microsoft engineers build a browser that follows Web Standards? […] ➡
- ASU Wiki Workshop Last night, my friend and colleague Tom Foster invited be as a “guest expert” (hah!) for a class he is teaching at Arizona State University, “Social and Ethical Issues in Educational Media”. The students were all K-12 teachers, librarians, and media specialists, and they had amazing, heroic energy for a group who had worked all […] ➡
- The Sunday Triathalon In preparation for a mid September Grand Canyon trip, this past Sunday I completed the unofficial, unsanctioned CogDogBlog triathalon, which will not be covered on NBC or commented on by Bob Costas. The event included: A two mile mountain bike ride to Camelback Mountain A grueling ascent and descent of Camelback on the Cholla Trail […] ➡
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