“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.

Red arrow points to missing number where the page output reads "There are posts previously published on December 29th"

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.

https://twitter.com/djwudi/status/1212871226953101313

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 28th

  • 2019
    • In the SPLOT Footnotes it says 1. you can add your own features I’d say a good tool is one you do not have to wait for MasterCraftCompanyInc to make a feature for you, when there are pathways to hone it yourself. This follows up somewhat to my ode to WordPress as HyperCard re-incarnated, but also just what happens when I get an unexpected idea from reading someone’s […]
  • 2017
    • Certificates Framing, Wall Color, and O’Malley Easy Do Kits In anticipation for Saturday’s presentation of the Certificates project at the Creative Commons Global Summit this is yet another round at explaining the architecture (still developing), as likely a lot of details will not be covered. My idea/goal/dream has been not to pick or designate a single platform for the certificate (at least for the […]
  • 2016
    • Felix Watercolored My big/little sister Harriet is quite talented in many creative areas. I have a 26 year old quilt she made, an oil painting of the bicentennial tall ships she did in her teens, and a re-designed kitchen thanks to her help and decor taste. A little over a year ago she took up watercolor painting, […]
    • Mapping My Programming Logic: Detangling a GitHub Hosted Yarn Ball This is the textbook-ish way the process of computer programming is described: Identify the Problem Design a Solution Write the Program Check the Solution Why would anyone think programming is hard? Four easy steps! I cannot remember one programming task I have done in 20+ years that I would map out like that as my […]
  • 2013
    • Flickr CC Attribution Helper Fixed (version 0.7) cc licensed ( BY NC SA ) flickr photo shared by Tojosan Long ago when I was working at Maricopa, I called our computer repair department to fix some issue with an Apple computer. I was a bit incredulous when Bill the Repair technician opened the case, and whacked the hard drive with his screwdriver, […]
  • 2007
    • For Your Next Plasma Screen Enabled Event I am in danger of become a twitter centric fool. While others have identified it as having jumping the tuna, my own volume of twitter contact notices (must admit, I don’t add them all) has spiked significantly. Here in Arizona, I’d say Twitter has Jumped the Gila Monster. Another cool tool… TwitterCamp is a free […]
  • 2006
    • PodPress is the Plug My commenters Joe and D’Arcy were right- PodPress is dah thing for generating iTunes ready feeds from WordPress. I should have looked no farther than my own blog here which is where I had installed it! It does not require a custom replacement file for the WP standard distribution, has better configuration, and built in […]
    • No Ritz At All I’ve been eager to get back to doing audio interviews, and as noted previously, I was trying to track down an iRiver which I had used well in my previous work at Maricopa. The iFP models apparently are phasing out, in lieu of the DRM friendly T10s, which becuase of the “friendship”, are PC only. […]
  • 2005
    • Archive Templates As Summaries Ok, chipping away more at the WP templates. One of my blog software critcisms is the notion that an “archive” listing is just a bunch of the posts in a category or date range all glued together (see “All Your Archives Are Wrong”). To be honest, I should poke more through the WordPress docs and […]
    • Podless No More (thanks Mom!) My tirade of being an iPodless podcaster are no more! That’s correct, pod fans, I have a new iPod Shuffle, courtesy of my Mom in Florida as a birthday gift– I had put it on my list of “wishes”, so in her words: I don’t know what it is or what it does, but the […]
  • 2004
    • 3 College Centers for Teaching & Learning Are A’ Bloggin’ A number of our Maricopa colleges have their own faculty support centers for faculty development and technology infusion… we try and build some collaboration amongst them. Three of them now have been or are starting to, use weblogs to publish resources and events of interest tot heir faculty, actually all hosted in this very MovableType […]
    • Bike Geek Not relevant to anything but what’s happening around the office… When I started at Maricopa, I found the building had a locker room available, and for about 3 or 4 years, I was an everyday bicycle commuter- you can tell be the later 90s vintage of my “Wacked Out Bike To Work Page”. Part was […]
    • Post-Blog Wrap of of PhotoBlogging Presentation Well I think it went well. You just are not 100% sure doing an online presentation who is snoring at the other end. But we had some good discussion and some folks finally popped some images to a Conference PhotoBlog– oops, I forgot the context. Last week, I presented “Publish and Build Communities Around Digital […]
    • RSS School Time: RSS115 An online workshop of interest (tip of the blog hat to my colleague Jim Tipton) “RSS115: The Beginners Guide to Weblogs and RSS” led by Library Stuff guy Steven Cohen: If you have ever thought about creating your own weblog or utilizing an aggregator to read news but have been a bit skeptical then this […]
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 28th

  • 2019
    • In the SPLOT Footnotes it says 1. you can add your own features I’d say a good tool is one you do not have to wait for MasterCraftCompanyInc to make a feature for you, when there are pathways to hone it yourself. This follows up somewhat to my ode to WordPress as HyperCard re-incarnated, but also just what happens when I get an unexpected idea from reading someone’s […] &amp#x27A1;
  • 2017
    • Certificates Framing, Wall Color, and O’Malley Easy Do Kits In anticipation for Saturday’s presentation of the Certificates project at the Creative Commons Global Summit this is yet another round at explaining the architecture (still developing), as likely a lot of details will not be covered. My idea/goal/dream has been not to pick or designate a single platform for the certificate (at least for the […] &amp#x27A1;
  • 2016
    • Felix Watercolored My big/little sister Harriet is quite talented in many creative areas. I have a 26 year old quilt she made, an oil painting of the bicentennial tall ships she did in her teens, and a re-designed kitchen thanks to her help and decor taste. A little over a year ago she took up watercolor painting, […] &amp#x27A1;
    • Mapping My Programming Logic: Detangling a GitHub Hosted Yarn Ball This is the textbook-ish way the process of computer programming is described: Identify the Problem Design a Solution Write the Program Check the Solution Why would anyone think programming is hard? Four easy steps! I cannot remember one programming task I have done in 20+ years that I would map out like that as my […] &amp#x27A1;
  • 2013
    • Flickr CC Attribution Helper Fixed (version 0.7) cc licensed ( BY NC SA ) flickr photo shared by Tojosan Long ago when I was working at Maricopa, I called our computer repair department to fix some issue with an Apple computer. I was a bit incredulous when Bill the Repair technician opened the case, and whacked the hard drive with his screwdriver, […] &amp#x27A1;
  • 2007
    • For Your Next Plasma Screen Enabled Event I am in danger of become a twitter centric fool. While others have identified it as having jumping the tuna, my own volume of twitter contact notices (must admit, I don’t add them all) has spiked significantly. Here in Arizona, I’d say Twitter has Jumped the Gila Monster. Another cool tool… TwitterCamp is a free […] &amp#x27A1;
  • 2006
    • PodPress is the Plug My commenters Joe and D’Arcy were right- PodPress is dah thing for generating iTunes ready feeds from WordPress. I should have looked no farther than my own blog here which is where I had installed it! It does not require a custom replacement file for the WP standard distribution, has better configuration, and built in […] &amp#x27A1;
    • No Ritz At All I’ve been eager to get back to doing audio interviews, and as noted previously, I was trying to track down an iRiver which I had used well in my previous work at Maricopa. The iFP models apparently are phasing out, in lieu of the DRM friendly T10s, which becuase of the “friendship”, are PC only. […] &amp#x27A1;
  • 2005
    • Archive Templates As Summaries Ok, chipping away more at the WP templates. One of my blog software critcisms is the notion that an “archive” listing is just a bunch of the posts in a category or date range all glued together (see “All Your Archives Are Wrong”). To be honest, I should poke more through the WordPress docs and […] &amp#x27A1;
    • Podless No More (thanks Mom!) My tirade of being an iPodless podcaster are no more! That’s correct, pod fans, I have a new iPod Shuffle, courtesy of my Mom in Florida as a birthday gift– I had put it on my list of “wishes”, so in her words: I don’t know what it is or what it does, but the […] &amp#x27A1;
  • 2004
    • 3 College Centers for Teaching & Learning Are A’ Bloggin’ A number of our Maricopa colleges have their own faculty support centers for faculty development and technology infusion… we try and build some collaboration amongst them. Three of them now have been or are starting to, use weblogs to publish resources and events of interest tot heir faculty, actually all hosted in this very MovableType […] &amp#x27A1;
    • Bike Geek Not relevant to anything but what’s happening around the office… When I started at Maricopa, I found the building had a locker room available, and for about 3 or 4 years, I was an everyday bicycle commuter- you can tell be the later 90s vintage of my “Wacked Out Bike To Work Page”. Part was […] &amp#x27A1;
    • Post-Blog Wrap of of PhotoBlogging Presentation Well I think it went well. You just are not 100% sure doing an online presentation who is snoring at the other end. But we had some good discussion and some folks finally popped some images to a Conference PhotoBlog– oops, I forgot the context. Last week, I presented “Publish and Build Communities Around Digital […] &amp#x27A1;
    • RSS School Time: RSS115 An online workshop of interest (tip of the blog hat to my colleague Jim Tipton) “RSS115: The Beginners Guide to Weblogs and RSS” led by Library Stuff guy Steven Cohen: If you have ever thought about creating your own weblog or utilizing an aggregator to read news but have been a bit skeptical then this […] &amp#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.

    If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
    Become a patron at Patreon!
    Profile Picture for CogDog The Blog
    An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

    Leave a Reply

    Your email address will not be published. Required fields are marked *