“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 27th
- 2020
- The SPLOT Goes On (as never sung by Sonny & Cher) I can hear a dated 1960s beat from the back of my brain… something to rev up the blog again. Yet different lyrics? The SPLOT goes on, the SPLOT goes on I keep pushing updates to the repos. La de da de de, la de da de da MOOCs was once the rage, uh huh […]
- 2016
- The Small Random Things That Openness Affords This kind of small act of near random #ds106 connection will not increase enrollments, will not “fix” education, will not improve institutional metrics… yet I just cannot let it slip by without a small “wow”. And the ironic thing is that the tweet in which I saw it came into my view about 5 minutes […]
- 2015
- Am I Switching My Creative Commons Licenses Back to BY Again? That dog named “Loki” is not rolling over, she is flipping (?) In my last post, I suggested questioned perhaps that The Chronicle of Higher Education was not following the guidelines of reusing my flickr Creative Commons Share-ALike licensed photo. With some twitter nudges by Bryan Alexander, I did get an answer from the Chronicle […]
- 2012
- Get Ready For #ds106 Summer Camp cc licensed ( BY ) flickr photo shared by cogdogblog Jim Groom and I are in the last home stretch of ds106 at University of Mary Washington, final projects and last blog posts being due Sunday, and next week being individual review sessions. After an intense semester, as hard working academics we ought to head […]
- 2010
- Lazy Dog’s Screencast cc licensed flickr photo shared by [cine]diego While I see the value of screencasts to explain technology or web sites, I don’t do them very often– there is something about having something explained to me at someone else’s pace that scratches me a little sideways. But a reason did come up lately over at NMC […]
- WordPress Code Circles cc licensed flickr photo shared by M.H.ick9s Arrgh, just spent about an hour and half chasing myself in silly code circles. Not that it matters, but just to document my sanity/lack thereof… I have a few WordPress pages hanging off the top banner, and I’d previously had them use PHP code in the pages, using […]
- 2008
- The Presentation File != The Presentation (and 3D Foolishness) As I follow links and burrow around presentations on places like Slideshare its invigorating that a lot of people are embracing a more visual presentations style, where in fact a lot of the sones you see are all images, nary a bullet point to be seen. There is, however, a pitfall. On its own, these […]
- 2007
- Wired. Tired. Expired. Expired Passively sitting in the glow of an overhead projector watching a presenter read words from a yellowed transparency. Tired Passively sitting in the glow of an LCD projector watching a presenter read words from a PowerPoint word slide. Wired Actively twittering in the glow of a laptop listening to a presenter read words in […]
- 2006
- Better Podcast Feeds with iPodCatter Plug-in Just found the WordPress plug-in WP-iPodCatter which creates iTunes ready RSS feeds from a WordPress blog. This became necessary as I dabbled with posting my first enhanced podcast file, and noticed that WordPress never put the *.m4a file in as an enclosure. It turns out, WP is pretty limited on what it seeks for enclosures […]
- Personal Broadcasting, Education, and the Remix Culture I am trying some live blogging from the NMC Online Conference. Now up is a keynote… Personal Broadcasting, Education, and the Remix Culture Laura Blankenship, Bryn Mawr College (blogs as Geeky Mom) Wired Magazine feature– not new, there is a history that goes back even to Shakespeare. Now- Writer’s Duel (harry potter Fanfiction) Sampling, remixing, […]
- eLiterate on ePort(able)Folios Michael Feldstein has written in a few concise paragraphs, one of the best frameworks for looking at electronic portfolios, via a “box of stuff” in the basement metaphor: Anyway, I’ve said on a number of occasions that ePortfolios are a lot like artificial intelligence in that they will be only a year away for the […]
- 2005
- Don’t feed: the Tiger Well, humph, Apple, is well, updating in a rather… um… “Redmondian” way. The OS X 10.3.9 update has done a few things to Safari (I still cannot find the supposed HTML editor, but viewing RSS feed URLs looks even worse in the browser window). But here is a real kicker. While updating my new blog […]
- My First WP Hack I just wrote a itty bitty PHP script to deal with my 800+ imported MovableType posts- as far as my newbie eyes could see, the Permalink URLs contstructed from these were producing some 3 mile URLs because the format I used based on the post name. On new WP entries, I have options to create […]
- Hey I am Just Starting I feel like a gleeful, wet by the ears, just discovered blog software newbie. On one hand I hate starting over, giving up a system I knew insanely well, into a place where I am operating with 12 thumbs. Last night I jumped too quickly into the Theme land, so as WordPress is so easy […]
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 27th
- 2020
- The SPLOT Goes On (as never sung by Sonny & Cher) I can hear a dated 1960s beat from the back of my brain… something to rev up the blog again. Yet different lyrics? The SPLOT goes on, the SPLOT goes on I keep pushing updates to the repos. La de da de de, la de da de da MOOCs was once the rage, uh huh […] ➡
- 2016
- The Small Random Things That Openness Affords This kind of small act of near random #ds106 connection will not increase enrollments, will not “fix” education, will not improve institutional metrics… yet I just cannot let it slip by without a small “wow”. And the ironic thing is that the tweet in which I saw it came into my view about 5 minutes […] ➡
- 2015
- Am I Switching My Creative Commons Licenses Back to BY Again? That dog named “Loki” is not rolling over, she is flipping (?) In my last post, I suggested questioned perhaps that The Chronicle of Higher Education was not following the guidelines of reusing my flickr Creative Commons Share-ALike licensed photo. With some twitter nudges by Bryan Alexander, I did get an answer from the Chronicle […] ➡
- 2012
- Get Ready For #ds106 Summer Camp cc licensed ( BY ) flickr photo shared by cogdogblog Jim Groom and I are in the last home stretch of ds106 at University of Mary Washington, final projects and last blog posts being due Sunday, and next week being individual review sessions. After an intense semester, as hard working academics we ought to head […] ➡
- 2010
- Lazy Dog’s Screencast cc licensed flickr photo shared by [cine]diego While I see the value of screencasts to explain technology or web sites, I don’t do them very often– there is something about having something explained to me at someone else’s pace that scratches me a little sideways. But a reason did come up lately over at NMC […] ➡
- WordPress Code Circles cc licensed flickr photo shared by M.H.ick9s Arrgh, just spent about an hour and half chasing myself in silly code circles. Not that it matters, but just to document my sanity/lack thereof… I have a few WordPress pages hanging off the top banner, and I’d previously had them use PHP code in the pages, using […] ➡
- 2008
- The Presentation File != The Presentation (and 3D Foolishness) As I follow links and burrow around presentations on places like Slideshare its invigorating that a lot of people are embracing a more visual presentations style, where in fact a lot of the sones you see are all images, nary a bullet point to be seen. There is, however, a pitfall. On its own, these […] ➡
- 2007
- Wired. Tired. Expired. Expired Passively sitting in the glow of an overhead projector watching a presenter read words from a yellowed transparency. Tired Passively sitting in the glow of an LCD projector watching a presenter read words from a PowerPoint word slide. Wired Actively twittering in the glow of a laptop listening to a presenter read words in […] ➡
- 2006
- Better Podcast Feeds with iPodCatter Plug-in Just found the WordPress plug-in WP-iPodCatter which creates iTunes ready RSS feeds from a WordPress blog. This became necessary as I dabbled with posting my first enhanced podcast file, and noticed that WordPress never put the *.m4a file in as an enclosure. It turns out, WP is pretty limited on what it seeks for enclosures […] ➡
- Personal Broadcasting, Education, and the Remix Culture I am trying some live blogging from the NMC Online Conference. Now up is a keynote… Personal Broadcasting, Education, and the Remix Culture Laura Blankenship, Bryn Mawr College (blogs as Geeky Mom) Wired Magazine feature– not new, there is a history that goes back even to Shakespeare. Now- Writer’s Duel (harry potter Fanfiction) Sampling, remixing, […] ➡
- eLiterate on ePort(able)Folios Michael Feldstein has written in a few concise paragraphs, one of the best frameworks for looking at electronic portfolios, via a “box of stuff” in the basement metaphor: Anyway, I’ve said on a number of occasions that ePortfolios are a lot like artificial intelligence in that they will be only a year away for the […] ➡
- 2005
- Don’t feed: the Tiger Well, humph, Apple, is well, updating in a rather… um… “Redmondian” way. The OS X 10.3.9 update has done a few things to Safari (I still cannot find the supposed HTML editor, but viewing RSS feed URLs looks even worse in the browser window). But here is a real kicker. While updating my new blog […] ➡
- My First WP Hack I just wrote a itty bitty PHP script to deal with my 800+ imported MovableType posts- as far as my newbie eyes could see, the Permalink URLs contstructed from these were producing some 3 mile URLs because the format I used based on the post name. On new WP entries, I have options to create […] ➡
- Hey I am Just Starting I feel like a gleeful, wet by the ears, just discovered blog software newbie. On one hand I hate starting over, giving up a system I knew insanely well, into a place where I am operating with 12 thumbs. Last night I jumped too quickly into the Theme land, so as WordPress is so easy […] ➡
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.