Working on a project, I had an image which faded on hover. a:hover img.fader { transition: opacity 0.5s ease-out; } a:hover img.fader { opacity: 0.5; } I was getting a weird bug where the image would jiggle during the fade. Thanks to this CSS Tricks thread, I learned the problem was that since this image […]
Draft Posts
functions.php vs plugin vs mu-plugin for WordPress
It is common for articles on writing WordPress code to refer to adding the code to the functions.php file in the active theme. This is one location where code can be added but it isn’t always the best. Places to Add WordPress Code a new file in wp-content/mu-plugins a new plugin in wp-content/plugins the functions.php […]
Load Newest CSS in WordPress
When developing a WordPress theme, I often need to ensure I’m loading the latest version of the CSS file I’m working on. One way to do this is by appending a URL parameter (e.g. ?ver=123) that gets updated each time the file gets updated. Load Newest Assets Plugin Thanks to Corey Salzano for pointing out […]
Activity Monitor find App behind Process Name
When working on my Mac, sometimes I find a process in Activity Monitor and I want to know what application the process belongs to. I was introduced to this command to do just that.
Add Additional Bootstrap 4 Container Size
With the prevalence of large monitors, I’ve found I wanted a larger container size than the default in Bootstrap 4, which is 1140px. Fortunately, working with the Bootstrap 4 Sass code it only takes a few lines of code to add an additional container size (and breakpoint to go with it).
JavaScript Distance Between Two Locations
When working with locations in JavaScript, you often have two sets of latitude/longitude coordinates and you need the distance between theme. This function will give you an approximate distance between theme (in miles by default).
WordPress Theme Path and URI
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()
WordPress Development Overlay
When doing WordPress theme development I find it helpful to overlay an image of the approved design on top of the code I’m working on. I use a reduced opacity on the image so I can see the code I’m working on. This helps me match things like font size and spacing. I’ve been doing […]
WordPress CodeSniffer phpcs.xml
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.
WordPress .editorconfig
The editorconfig project provides a powerful tool for standardizing the general coding standards used in a project, specifically in regards to: indent_style, indent_size, end_of_line, charset, trim_trailing_whitespace, and insert_final_newline.