Posts relating to
Development
The awesome Delicious Brains team acquire ACF & ACF Pro!
June 10th, 2021So, ACF, one of the best developer plugins of the last century, is now part of the Delicious Brains family. What does this mean for ACF, ACF Pro and the vast ACF client base? What are ACF and ACF Pro? Elliot Condon, the sole developer behind ACF to date, has made one of the most […]
How to create a horizontally scrolling section with 2 rows using CSS grid
September 9th, 2020Creating horizontal scrolling of multiple rows with display: grid is easy. CSS grid provides powerful layout options to help achieve all sorts of page layouts.
Inlining CSS – the Good, the Bad and the Ugly
November 26th, 2019I’m a sucker for performance gains to the point that I’m convinced I’m actually losing time overthinking it – š¤ A good example is CSS delivery and it’s always interesting to get others’ opinions on how important they consider styling performance to be and how they measure it. Inlining – good/bad/ugly? Good I see genuine […]
Convert br tags to span tags
July 6th, 2019Have you ever needed to convert the string immediately before brĀ tags and wrap it in spanĀ tags instead? Me too. There is very likely a regex solution but here’s a very simple way to achieve it using string and array functions. /** * Replace linebreaks with span tags * * Wraps each string immediately before a […]
Updating Macs on Mojave to run VirtualBox
November 20th, 2018We use VirtualBox for the local development of websites, this article walks through the process of updating it to at least 5.2.22. Why update VirtualBox? Simple: Older versions of VirtualBox will not be compatible with macOS Mojave. The simple fix Grab the latest version of VirtualBox, install it and you’re! Conclusion As we use VirutalBox […]
How to trim words by character limit
October 21st, 2018We recently encountered a scenario where the client wanted to trim the news items titles to a maximum number of characters, whilst respecting words. Our research revealed that this seemingly obvious requirement wasn’t elegantly solved. As most of you will know, there are solutions for trimming by characters or trimming by words, but neither of […]
WP Code Tip: get array of post IDs
October 18th, 2018A number of times over my years developing in WordPress I’ve needed to extract the post IDs of the posts in an array. And every time I need to do this I use the wp_list_pluck() function, from WP_List_Util, the WordPress list utility class. And every time I use this really handy helper I mean to […]
Use PHP’s in_array() to compare a variable to multiple values
September 28th, 2018When comparing a variable with multiple values consider using in_array(), instead of complex if expressions. I love clean, easy-to-read code, which is why I am not a fan of if statements with complex expressions. For example, consider the following snippet, which is checking a variable against several values: if ($test_variable === 'value1' || $test_variable === […]
Setting up PHP composer
August 28th, 2018This article walks through the simple steps for setting up composer. Initially at project level, then, optionally, at the global level. Note: This article is for Mac(Unix)/Linux users, please refer the official docs for Windows. What is Composer? Composer is the dependency manager for PHP packets. In my opinion it should be in every web […]
How to fix macOS usr/local is not writable
August 21st, 2018This simple post should fix the “usr/local is not writable” issue with homebrew. Whilst on holiday I needed to use an old MacBook to crack on with some work. In order to do so I had to install the latest version of ansible, but encountered the permissions error “usr/local is not writable”. I found uninstalling […]