X

BLOG

Adding Feature Images to the WordPress RSS Feed

The WordPress RSS feed is great. We use it with third-party services, such as MailChimp. One key datum that isn't…

Mervyn Booth

How to trim words by character limit

We recently encountered a scenario where the client wanted to trim the news items titles to a maximum number of…

Mervyn Booth

WP Code Tip: get array of post IDs

A number of times over my years developing in WordPress I've needed to extract the post IDs of the posts…

Mervyn Booth

Use PHP’s in_array() to compare a variable to multiple values

When comparing a variable with multiple values consider using in_array(), instead of complex if expressions. I love clean, easy-to-read code,…

Mervyn Booth

How to reindex spotlight on macOS to stop it closing after a few characters

This post is a somewhat off-topic, but for all those of you that are working on Macs, here's a little…

Mervyn Booth

Setting up PHP composer

This article walks through the simple steps for setting up composer. Initially at project level, then, optionally, at the global…

Mervyn Booth

How to fix ansible/vagrant ERROR! the role ‘swapfile’ was not found

This article provides a simple fix for the ansible error, "sorry, tersmitten.swapfile was not found", by updating 1 (maybe 2?)…

Mervyn Booth

How to fix macOS usr/local is not writable

This simple post should fix the "usr/local is not writable" issue with homebrew. Whilst on holiday I needed to use…

Mervyn Booth

How to prevent Yoast from setting noindex on pages

On a few occasions Yoast has inexplicably injected a noindex meta tag in the head of pages that I want…

Mervyn Booth

How to call wp_get_attachment_image() without srcset

Sometimes it's nice to have all the goodies wrapped up in a nice little function, such as wp_get_attachment_image(). This is…

Mervyn Booth

This website uses cookies.