“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 October 17th
- 2021
- WordPress Tag List (if you tag past 45…) Coming uo with solutions to WordPress needs often means finding a different tree to bark at. I’m never surprised to discover along the way some dusty niche in the code. For example, in the tale I spin out here, I never knew there was a limit for the number of tags the default tag cloud […]
- 2016
- 20 Years Since I Was Home for an Election The last time I was home for a Presidential Election was 1996, when the other Clinton won. Oh I definitely voted in every election by mail-in ballot. Let’s peel those elections off… In 2000, I was in the third leg of my 6 month sabbatical from the Maricopa Community Colleges, in Canberra Australia. According to […]
- Rating UDG Agora Comparte Reports on a Scale of 1-5 Tacos We have just finished the 8 week online phase of the UDG Agora project, this the second year I have been part of this project run by the Justice Institute of British Columbia for faculty at the University of Guadalajara. This is where we tell them about Comparte (Spanish for “Share”), a site I made […]
- 2015
- +/- memorable (my ***x talk) Yes, as my friend Barbara Ganley teased me last week, today i did a fancy pants ****x (TEDx) talk here in San Juan, Puerto Rico. This was made possible by the incredibly generous/gracious Antonio Vantaggiato who invite me to speak at TEDx USagrado Corazón. The theme was “Think + Act”. More may be written about […]
- 2013
- “As The Web Does: An Innovation Toolkit” …. feedback please! cc licensed ( BY NC ND ) flickr photo shared by Margaret Almon UPDATE: Nov 2, 2013: See the final application and goofy Alan at Stonehenge video I’m scrambling somewhat to prepare by the end of the month a proposal for a Shuttleworth Foundation fellowship; below are bits or bypass by waffling and go to […]
- 2011
- Road Stats: Week 17 I fund this post lingering in the drafts. Next week’s will be hard to document! cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 112 Miles Driven: 10,859 Most Recent 1000 mile marker: 10,000 miles, just west of Richmond, VA Number of States/Provinces driven in: 21 Number of […]
- Chasing the Center of the Internet: The Tracks We Leave It’s been another strange day in this place of mystery. I took shelter last night on this deck behind an industrial building; again it was dead quiet all night long except for a constant electronic hum in the air and very distant noises of hovering helicopters. cc licensed ( BY ) flickr photo shared by […]
- 2010
- The DynabookPad I’m finally getting my health and schedule back into the readings for Gardner Campbell’s Networked Seminar, where this week the reading (or maybe it was last week) was Alan Kay and Adele Goldberg’s Personal Dynamic Media (it is available as a free chapter download from the Nee Media Reader). It’s easy to focus on the […]
- Ye Old Repository cc licensed flickr photo shared by The Rocketeer Who ever thought the word “repository” was a good idea? C’mon, nearly every one’s connotations go elsewhere and sure, I’m going to be encouraged to go add something (or fond something) I created to something that sounds like something that goes up your butt? But I digress. […]
- 2008
- Groove to the Twitter Love Song Twitter: the music video– A great compendium of visual message about twitter by Martin Weller, its uses, not, and groovy music by Death Cab Cutie I Will Posses your Heart For more fun catch Martin’s EduPunk video Hee fun to see my Twitter Life Cycle in the mix. Share this barking on social media
- Academia as a Walled Forest of Structured Trees? I flipped to Academia.edu after reading one blogger referring to it as “Facebook for Academia” and while it has a few FB-like features (updates) I could not think of a more opposite description for a social network. My analysis here is admittedly first impressions and shallow 😉 What it seems to provide is a social […]
- 2004
- Slapping the Wiki Around Over at Kairosnews, blacklily8 has some strong words about the new found obsession with wikis: Wikis are one of those internet phenomena that are confusing, intruiging, powerful, and often misunderstood. Many users and even some programmers of wiki software have missed the point completely, and from what I’ve observed in scholarly discussions on the subject, […]
- Toogle Retro Back to ASCII Art? Or Not? Toogle takes a twist and strong copy of Google’s Image search except rather than return images scraped from web pages, it returns a visual representation of the search words made entirely out of text. it harkens back to the old monochrome terminal days of ASCII art. But this is way more fun… Toogle is a […]
- 2003
- Those Wild Wacky Norwegians Sometimes you can click yourselves into the most fun, obscure, un-googled parts of the web, such as Rune Johansen’s portfolio. Pure serendipitous fun. Okay, the music grates, but the pictures I gather are pictures of the home life of people in the far flung parts of Norway. There are great detailed shots of objetcs (they […]
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 October 17th
- 2021
- WordPress Tag List (if you tag past 45…) Coming uo with solutions to WordPress needs often means finding a different tree to bark at. I’m never surprised to discover along the way some dusty niche in the code. For example, in the tale I spin out here, I never knew there was a limit for the number of tags the default tag cloud […] ➡
- 2016
- 20 Years Since I Was Home for an Election The last time I was home for a Presidential Election was 1996, when the other Clinton won. Oh I definitely voted in every election by mail-in ballot. Let’s peel those elections off… In 2000, I was in the third leg of my 6 month sabbatical from the Maricopa Community Colleges, in Canberra Australia. According to […] ➡
- Rating UDG Agora Comparte Reports on a Scale of 1-5 Tacos We have just finished the 8 week online phase of the UDG Agora project, this the second year I have been part of this project run by the Justice Institute of British Columbia for faculty at the University of Guadalajara. This is where we tell them about Comparte (Spanish for “Share”), a site I made […] ➡
- 2015
- +/- memorable (my ***x talk) Yes, as my friend Barbara Ganley teased me last week, today i did a fancy pants ****x (TEDx) talk here in San Juan, Puerto Rico. This was made possible by the incredibly generous/gracious Antonio Vantaggiato who invite me to speak at TEDx USagrado Corazón. The theme was “Think + Act”. More may be written about […] ➡
- 2013
- “As The Web Does: An Innovation Toolkit” …. feedback please! cc licensed ( BY NC ND ) flickr photo shared by Margaret Almon UPDATE: Nov 2, 2013: See the final application and goofy Alan at Stonehenge video I’m scrambling somewhat to prepare by the end of the month a proposal for a Shuttleworth Foundation fellowship; below are bits or bypass by waffling and go to […] ➡
- 2011
- Road Stats: Week 17 I fund this post lingering in the drafts. Next week’s will be hard to document! cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 112 Miles Driven: 10,859 Most Recent 1000 mile marker: 10,000 miles, just west of Richmond, VA Number of States/Provinces driven in: 21 Number of […] ➡
- Chasing the Center of the Internet: The Tracks We Leave It’s been another strange day in this place of mystery. I took shelter last night on this deck behind an industrial building; again it was dead quiet all night long except for a constant electronic hum in the air and very distant noises of hovering helicopters. cc licensed ( BY ) flickr photo shared by […] ➡
- 2010
- The DynabookPad I’m finally getting my health and schedule back into the readings for Gardner Campbell’s Networked Seminar, where this week the reading (or maybe it was last week) was Alan Kay and Adele Goldberg’s Personal Dynamic Media (it is available as a free chapter download from the Nee Media Reader). It’s easy to focus on the […] ➡
- Ye Old Repository cc licensed flickr photo shared by The Rocketeer Who ever thought the word “repository” was a good idea? C’mon, nearly every one’s connotations go elsewhere and sure, I’m going to be encouraged to go add something (or fond something) I created to something that sounds like something that goes up your butt? But I digress. […] ➡
- 2008
- Groove to the Twitter Love Song Twitter: the music video– A great compendium of visual message about twitter by Martin Weller, its uses, not, and groovy music by Death Cab Cutie I Will Posses your Heart For more fun catch Martin’s EduPunk video Hee fun to see my Twitter Life Cycle in the mix. Share this barking on social media ➡
- Academia as a Walled Forest of Structured Trees? I flipped to Academia.edu after reading one blogger referring to it as “Facebook for Academia” and while it has a few FB-like features (updates) I could not think of a more opposite description for a social network. My analysis here is admittedly first impressions and shallow 😉 What it seems to provide is a social […] ➡
- 2004
- Slapping the Wiki Around Over at Kairosnews, blacklily8 has some strong words about the new found obsession with wikis: Wikis are one of those internet phenomena that are confusing, intruiging, powerful, and often misunderstood. Many users and even some programmers of wiki software have missed the point completely, and from what I’ve observed in scholarly discussions on the subject, […] ➡
- Toogle Retro Back to ASCII Art? Or Not? Toogle takes a twist and strong copy of Google’s Image search except rather than return images scraped from web pages, it returns a visual representation of the search words made entirely out of text. it harkens back to the old monochrome terminal days of ASCII art. But this is way more fun… Toogle is a […] ➡
- 2003
- Those Wild Wacky Norwegians Sometimes you can click yourselves into the most fun, obscure, un-googled parts of the web, such as Rune Johansen’s portfolio. Pure serendipitous fun. Okay, the music grates, but the pictures I gather are pictures of the home life of people in the far flung parts of Norway. There are great detailed shots of objetcs (they […] ➡
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