I thought myself rather clever to make a post about dealing with WordPress theme changes related to the parent theme that powers the TRU Writer SPLOT. But then it happened again. 

Yes, my work are dependent on someone else’s coding decisions here, but since Anders Norén has so many great themes I make use of, complaints are futile. Besides, I can see some of the changes are to address new features, changes with the Gutenberg editor (The changes have no effect on the front end visual editors used in my SPLOTs, not blocky stuff is needed/wanted there).

But then I happened to look at one of my sites powered by the TRU Collector theme and was confused why it indicated having many images, I could see only 1. It was not this exact site, but this is a symptom of a problem that will call for a few updates for your sites.

Scren shot of site stating there are 53 total images but on the right, you see only 2

Using the web inspector, I could see all the HTML for all the items… they are all stacked on top of each other. So the Fukasawa theme TRU Collector is built on was updated very recently (Dec 14, 2018), and my sites autoupdate themes. And the changes in the README (which I read!) pretty much indicated I’d have some rework:

There was a bit more I read, but the developer switched to a different code library for doing the front page masonry layout, so older TRU Collector sites were not doing layout correctly. And the structure updates too would present some issues as the template hierarchy (like the Magna Carta of WordPress) would be affected, not to mention changes in the layout of those templates. 

This would affect one of your sites IF your Fukasawa theme was updated to version 1.20 and (I am guessing) maybe WordPress was not updated to 5.x. I think both might be needed. I am not sure. Just tested on a site, the new themes don’t need WP5.

It was not too bad to go and adjust maybe 5 TRU Collector templates; it’s a matter of changing a few logic structures, and more conditionals on the singular.php template (that one is new to me).

This is how the updated site will look after getting the new version (1.51) of TRU Collector:

Layout restored for a TRU Collector site.

So if you have a TRU Collector site, and Fukasawa was updated to v 1.2, you will need a new version of the theme. I added a small section on updating. If you upload via file transfer, you need to make sure you remove the old archive.php and single.php templates.

I realize this all sounds confusing, but… shrug. I’m able to help fix if you get in a bind, send me a message via the issues in the github repo. Or yell below in the comments.

I also added a tiny tiny nifty feature too to use the name of the “item” in a collection (default is item, but you can change in the theme Customizer) to they are used on the navigation buttons.

I did solve another issue I discovered that likely no one will notice. I added quite a while ago a means to list all items by licenses (example) and even got fancy with a rewrite rule to create pretty links to show all items with a specific license (example).

Well I noticed that the pagination buttons at the bottom did not work. After a ton of head banging (this is all done with custom queries in a page template, so pagination is tricky), consulting the leading  authorities (StackExchange), I found my clever rewrite rule was not so clever because it tossed the parameter which provided the page number! This was the old code:

Oh it would take some regex probing, sigh, so deal with having to parse two variables, one of which is optional (partial answer here). I needed to add a second rule to look for both the license flavor variable AND the page one, isn’t that fascinating?

But the suggestion there really provided the debugging tool I needed, the Rewrite Rules Inspector plugin is a hugely useful tool for debugging issues with pretty links gone bad. I was able to try different URLs and see if my rules matched. Success! (actually I needed to flush the rules too, that was an issue).

Testing the rewrite rules with the Rewrite Inspector Rules plugin

Anyhow, enough code gibbering. I was able to fix this small problem; see it working in action at http://splot.ca/collector/licensed/cc-by/page/3/ (where I notice now, the new rule is not added until you go to Permalinks and save).

I need to add this update to SPLOT Box theme as well.

So these parent issues can be a problem, but they are not to hard to solve. I’m sorry if this messed up your site! But I can help.

And again, I do all of this on my on dime/time. I cannot stop.

SPLOT can’t stop!


Featured Image: Farrar from the LIbrary of Congress shared into the public domain because the LOC is cool.

If this kind of stuff has any value, please support me monthly on Patreon or a one time PayPal kibble toss
Profile Picture for Alan Levine aka CogDog
An early 90s builder of the web 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.

Leave a Reply

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