“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 11 posts previously published on September 5th
- 2017
- Brute Force Digging a Top Posts Page This was not the post I thought I was writing. But as blogging does, I went in to write one thing, and in looking for some information I was digging…. Not that I gaze at the blog stats a lot, but my post is will be about the silly posts that end up getting noticed […]
- This is not the online learning you (or we) are looking for Yes, I am no Obi Wan Kenobi, have no Jedi mind tricks, and am completely mangling the classic Star Wars line. But I like it. In the notification letter I received last month for the institution I am adjunct teaching for (remotely) this semester, there was an offer to complete a New Faculty Orientation that […]
- 2016
- Less of Me There is less of me going around. I’m talking technically about mass, of which, as we recall from high school physics, combines with gravity to give as what we call weight. It’s not the gripping horror story Jim wrote about as The Shrinking Man. But I am closing in on being 20 pounds lighter since […]
- 2013
- Guess What I Did Today? I Animated Cow Poop! Do you get to do that in your fancy MOOC? What more do you need to know to be part of ds106? And the beauty is, you can start this creative experience at any time. You are never behind, or missing out on some quiz to get some chips. I digress. I thought this photo […]
- Want to Make Some Fake Assignments? Open Now at ds106 Assignment Bank Neuvo Some updates on the construction of a WordPress theme that will give you the features of the ds106 assignment bank. Bottom line- there’s a lot to account for to make something flexible. With a few more pieces to add, I hope I can make an alpha version available next week. And yes, the look is […]
- 2012
- I Guess What [some] Consultants do is Steal I do not know much about business. But I guess I have a lot to learn from the Gilfus Education Group: The Gilfus Education Group offers independent consulting, technical implementation and industry research services to educational institutions, industry investors and the educational companies that serve them. We partner to help organizations become better positioned to […]
- 2011
- The Vague Line cc licensed ( BY NC SD ) flickr photo shared by miuenski “Who are we when we write online?” asks Claudia Ceraso in Some Thoughts on Identity- Particularly Mine. This timing is interesting, as tomorrow I am scheduled to talk to Claudia on Skype for the first time. We’ve connected online since 2007, but only […]
- <3 #Cookielove I cannot say much more than thanks for the wave of cookie making/sharing that occurred yesterday in honor of my mom (see http://bit.ly/cookielove). I saw activity everywhere from Calgary to Buenos Aires, from Vancouver to Florida, from Portal AZ to London, sharing with dog walkers, roofers, homeless in San Francisco, garage sales in Guelph. There […]
- 2009
- Hashtag Per Post Works! Darn, I should have gone by my usual route of trying things before I blog about them. In a previous post, I speculated about using WordPress and the Twitter Tools Plugin to add a hashtag to posts to either aggregate them (among multiple bloggers) or segrate them (for a single blogger with several sites). My […]
- 2006
- ASSY, INVERTER,NEC-TOKIN,3%,MBPRO15″ flickr foto Return of MacBookProavailable on flickr My MacBookPro returned from its vacation to Houston, where it got some new screen parts and a battery replacement. So far so good, it works My MacBookPro is back and it works (well so far, a few hours). This MBP better stay lit, as in another day, I […]
- 2005
- A Tale of Technology & Two Organizations: CNN vs Education I would not suggest that higher education institutions need to operate like CNN, but I find it fascinating to read Elliot Masie’s observations of how CNN dealt with the flow of content and information in the wake of Hurrican Katrina. In CNN Newsroom in the Midst of Katrina – “Rapid Development… Content Objects… Learning Implications”: […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 11 posts previously published on September 5th
- 2017
- Brute Force Digging a Top Posts Page This was not the post I thought I was writing. But as blogging does, I went in to write one thing, and in looking for some information I was digging…. Not that I gaze at the blog stats a lot, but my post is will be about the silly posts that end up getting noticed […] &#x27A1;
- This is not the online learning you (or we) are looking for Yes, I am no Obi Wan Kenobi, have no Jedi mind tricks, and am completely mangling the classic Star Wars line. But I like it. In the notification letter I received last month for the institution I am adjunct teaching for (remotely) this semester, there was an offer to complete a New Faculty Orientation that […] &#x27A1;
- 2016
- Less of Me There is less of me going around. I’m talking technically about mass, of which, as we recall from high school physics, combines with gravity to give as what we call weight. It’s not the gripping horror story Jim wrote about as The Shrinking Man. But I am closing in on being 20 pounds lighter since […] &#x27A1;
- 2013
- Guess What I Did Today? I Animated Cow Poop! Do you get to do that in your fancy MOOC? What more do you need to know to be part of ds106? And the beauty is, you can start this creative experience at any time. You are never behind, or missing out on some quiz to get some chips. I digress. I thought this photo […] &#x27A1;
- Want to Make Some Fake Assignments? Open Now at ds106 Assignment Bank Neuvo Some updates on the construction of a WordPress theme that will give you the features of the ds106 assignment bank. Bottom line- there’s a lot to account for to make something flexible. With a few more pieces to add, I hope I can make an alpha version available next week. And yes, the look is […] &#x27A1;
- 2012
- I Guess What [some] Consultants do is Steal I do not know much about business. But I guess I have a lot to learn from the Gilfus Education Group: The Gilfus Education Group offers independent consulting, technical implementation and industry research services to educational institutions, industry investors and the educational companies that serve them. We partner to help organizations become better positioned to […] &#x27A1;
- 2011
- The Vague Line cc licensed ( BY NC SD ) flickr photo shared by miuenski “Who are we when we write online?” asks Claudia Ceraso in Some Thoughts on Identity- Particularly Mine. This timing is interesting, as tomorrow I am scheduled to talk to Claudia on Skype for the first time. We’ve connected online since 2007, but only […] &#x27A1;
- <3 #Cookielove I cannot say much more than thanks for the wave of cookie making/sharing that occurred yesterday in honor of my mom (see http://bit.ly/cookielove). I saw activity everywhere from Calgary to Buenos Aires, from Vancouver to Florida, from Portal AZ to London, sharing with dog walkers, roofers, homeless in San Francisco, garage sales in Guelph. There […] &#x27A1;
- 2009
- Hashtag Per Post Works! Darn, I should have gone by my usual route of trying things before I blog about them. In a previous post, I speculated about using WordPress and the Twitter Tools Plugin to add a hashtag to posts to either aggregate them (among multiple bloggers) or segrate them (for a single blogger with several sites). My […] &#x27A1;
- 2006
- ASSY, INVERTER,NEC-TOKIN,3%,MBPRO15″ flickr foto Return of MacBookProavailable on flickr My MacBookPro returned from its vacation to Houston, where it got some new screen parts and a battery replacement. So far so good, it works My MacBookPro is back and it works (well so far, a few hours). This MBP better stay lit, as in another day, I […] &#x27A1;
- 2005
- A Tale of Technology & Two Organizations: CNN vs Education I would not suggest that higher education institutions need to operate like CNN, but I find it fascinating to read Elliot Masie’s observations of how CNN dealt with the flow of content and information in the wake of Hurrican Katrina. In CNN Newsroom in the Midst of Katrina – “Rapid Development… Content Objects… Learning Implications”: […] &#x27A1;
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