Pages
WordPress had a point release update earlier this week, 4.4.1. And it broke my website.
The pagination at the bottom of the site would not work. It would only return to the front page of the site.
I use the Enfold theme for this website so I thought I should check there first. And, sure enough, lots of sites were reporting the same problem.
I logged a support request and I was asked to try a lot of code changes. No joy. Nothing worked.
Finally, it became evident that the root cause was not in the theme itself but somewhere in the core of the most recent release of WordPress. You can find the rather curious thread about that particular bug here. It makes for some fascinating reading about how open source issues are identified, tracked and resolved.
Funny how little things have changed. We still have to write code not unlike how we did several decades ago.
I was looking at some old C code that I had written back in the early 1990s — over 25 years ago. I had written a text editor and here is one of the functions from my source code:
And here is the PHP code that I had to change in the WordPress core to regain the pagination function for the blog. I needed to remove the section of code with the comment “Old Post Paging” and replace it with the new section of code “New Post Paging”:
That PHP code does not look very elegant to me. Whenever I see multiple AND operators in a conditional statement with further nested conditional statements I get a bit nervous. It looks like a quick patch. It works but it doesn’t look very refined.
WordPress is largely built on PHP and PHP is very similar in syntax to C. The PHP code, though, just looks a bit “thick” to my eye.
C is still an incredibly elegant and poetic programming language. I always enjoyed producing compact, efficient software in C.
Dennis Ritchie was a genius.
Leave a Reply
Want to join the discussion?Feel free to contribute!