The WordPress plugin repository at wordpress.org/plugins is a great resource. I often use WP CLI to install plugins on my WordPress site from there, however, sometimes I want to install other plugins with WP CLI.
When creating new posts for a video demonstration, I wanted to display a consistent date. While my first thought was to reset my system clock, this snippet overrides the date when the post is first created, which worked for me.
I setup a site for WordPress Core development with Local by Flywheel and documented the steps. If you’re trying to do the same, this might be helpful.
In one of my other posts I am displaying some URLs on their own line as part of the content however the WordPress oEmbed functionality is turning these into rich HTML. I was able to suppress this by wrapping the URLs in HTML span tags.
On a WordPress project, I wanted to display the full post on the blog archive unless a manual excerpt had been created for the post (in which case I wanted to use the manual excerpt). Here is the code I used to make this happen.
When working with a WordPress image, I wanted the attributes for the image. The function `wp_get_attachment_image()` provides me everything I need but in a rendered HTML string, rather than a more useful array of attributes. I was surprised I was unable to locate a good way to get this information, so I wrote this code to help me.
As of this writing, WordPress has a market share of approximately 31%. I often hear people referencing the “goal” of WordPress reaching 51% marketshare. I don’t understand this goal.
Slow websites are painful. An important value to look at when optimizing your website is the TTFB (Time Til First Bye), which is the delay between when the request is sent to the server and server actually responds. These are some of my notes on improving (e.g. reducing) the TTFB of a WordPress website.
WordPress comes with some helper functions for finding a theme’s path and/or URI, which are tremendously useful but I always have to look them up. Therefore, I’m making note of them here so I know where to look them up: get_stylesheet_directory(), get_stylesheet_directory_uri(), get_template_directory(), get_template_directory_uri()
I’ve been using PHP CodeSniffer to help me following coding standards. The WordPress Coding Standards are a great resource and the basis of the rules I follow. I have made a few modifications based on my personal preferences.