During a long call at work where I was mostly listening, I did some housekeeping here at Idiot Central:
- I found a new plugin for sidebar posts and installed it, which means the shortlink categories are back up on the right side of the page. It required the addition of another plugin to work correctly—it’s what they call a “classic widget” and doesn’t work on WordPress 6.X without a backward-looking workaround. Not the best solution, but one that works.
- There was a bit of PHP I wrote at the end of each post which basically looked for any syndicated posts tagged “scout” and both changed the CSS to offset the post and added the explanatory block at the bottom, complete with direct links to that post on the Scout blog. When I updated the PHP engine behind the curtain to 8.0 a couple of months ago, my old code blew up so I had to find the issue there and fix that block.
- Finally, I wanted to remove the Flickr gallery at the bottom of the sidebar (I haven’t posted anything there in months) and replace it with Instagram; this took a couple of extra steps that aren’t in the documentation; what I had to do is hook up Instagram through Jetpack first and then link it up with the widget.
- I added a snippet of code to the functions.php file to supress any posts tagged “shortlinks” in the main feed:
function exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-30' );
}
}
add_action( 'pre_get_posts', 'exclude_category' );Where “30” is the category ID number. Because it’s within the main WordPress loop, it doesn’t affect the sidebar feed at all. A nice little hack that ensures I don’t need to add yet another plugin to do something dumb. Via this article.
I’ve been hosting photos here on the site pretty exclusively for the better part of the year. I used to use Flickr exclusively as my photo CDN, so almost every photo here from 2005 until this year is hosted there. Given all that’s been happening with external platforms coming and going, I’ve been thinking I need an automated solution to swap them out for local copies if and when Flickr ever goes away. I’ll have to look into how other people have handled that situation and if there’s a good script I can borrow.