The beauty of Gutenberg is that the HTML content is more structured and semantic while also simplifying the user experience. All of the data is stored in the post content, which is also great because we don’t have to request a bunch of post meta to render the page. On the other hand, if nothing … Continue reading Surfacing Gutenberg Blocks in the WordPress REST API
Oftentimes we think of the SOLID principles of object-oriented programming as just that: object-oriented programming principles. However, we are going to take a closer look at the second principle, the open-closed principle, and see how it applies to WordPress. You are probably thinking, “WordPress isn’t really object-oriented”… and you’d be mostly right. Much of WordPress is … Continue reading WordPress and the Open-Closed Principle
I’ve been a programmer for just over a decade now and have always shared and taught others as I’ve learned. However, much of that information has never really been documented except in the form of videos from talks at conferences. I want to take some time to offer a few tips to those who are … Continue reading Advice for New Programmers
The WordPress loop is ubiquitous. It is one of the first things you learn as a WordPress developer and it is something you must know the intricacies of in order to avoid causing problems. I’ve dreamt of a day when the WordPress loop and all its various implementations are no longer necessary. Today, I would … Continue reading Creating a Better WordPress Loop
WordPress plugins are great, but sometimes you want to avoid having additional settings screens or giving a client access to make changes that could break functionality on their website. If you aren’t a coder and you want to automatically expire a post in WordPress, I’d recommend that you check out the Post Expirator plugin. However, … Continue reading WordPress Post Expiration Module
I get asked a lot about how to handle different types of website redirects. Usually, someone wants to redirect an entire site, or maybe just redirect a subdomain. Other times, they want to do simple one-off redirects. Many web servers that run WordPress use Apache, which means that .htaccess rules will work. Other web servers like … Continue reading Redirect Entire Website Except WordPress Admin
WordPress automatically outputs a lot of helpful CSS class names for menus. If you use the
wp_nav_menu()function to display your menus, as all good themes should do, you don't have to settle for just the default class names.
You can prevent WordPress users from being able to deactivate plugins by hiding the 'Deactivation' links.