Just today I had to add a logo to a WordPress menu on a site I was working on. Because it is a graphic that I needed to add, I couldn’t easily use the default WordPress menu functionality to accomplish this. One possible workaround, I think, could have been to add a class to the…
Hiding empty paragraphs
For the most part, I have really warmed up to the Gutenberg editor in WordPress. It took me a while. I was very used to the “old ways,” but the flexibility and promise of Gutenberg have won me over. One small thing that I have noticed, though, is that it is really common for users…
Importing a MySQL Dump with Bad Dates
A problem that I run into fairly regularly when transferring older sites to my local environment is that, when importing the MySQL dump, I get an error like: ERROR 1292 – Incorrect date value: ‘0000-00-00’ It seems that, prior to version 5.7, MySQL used to allow invalid dates like 0000-00-00. However, this behavior changed in…
Adding the Page Order to the Page List in the WordPress Admin
I like to keep my WordPress sites’ admin areas as organized and clean as possible to limit confusion and to make items easy to find. One example of this is trying to keep my WordPress Pages in a logical order. When I look at the Pages list in the WordPress admin I like it to…
A Fallback for Ray
As I mentioned in a previous article, I really like using Ray for debugging as I develop WordPress projects. However, one thing that can be easy to do is to forget to remove all of your calls to ray() and upload to a production site where the Ray plugin is not installed. Then… ack! An…
Using an SVG Icon for a WordPress Custom Post Type
When creating a Custom Post Type in WordPress there is a convenient way to select a custom icon when registering the post type. WordPress comes with a set of built-in icons called Dashicons that have easy names that can be used for your menu_icon property: Having these icons at hand is great. Unfortunately, I often…
It’s (Not) a Shame About Ray
Allow me to admit a failing of mine. I always seem to have a problem getting Xdebug to work reliably. I actually felt like I had a pretty good handle on it using MAMP and PHPStorm. It mostly “just worked.” But after I added too many sites into MAMP, MAMP itself began to become unresponsive…
Creating a Rewrite Rule in WordPress
Recently I had to create an endpoint for users to view a dynamically-generated PDF on a site. I wanted to have a nice-looking URL for users. I found it difficult to wrap my head around the process of adding a rewrite rule in WordPress but I finally figured it out. WordPress offers a function, add_rewrite_rule,…
Passing PHP Variables to JavaScript in WordPress
One thing that I found difficult to understand when starting out with WordPress development was how to use PHP variables in my JavaScript. I’m not sure why I found it so confusing. There are a lot of good examples out there but I thought I would break down how use PHP variables in your JavaScript…
Transferring a WordPress Site from One Server to Another
One thing that I have to do fairly frequently is to move a WordPress site from one server to another. Examples of this can be moving a site from staging to production or production to my local environment. There are a lot of ways to do this but I thought I would document my process….