How to Show Featured Images From the Latest Posts in WordPress

A strip of recent post thumbnails is a common header or sidebar feature. Here is an efficient WP_Query version, and the block editor way to build it without code.

A strip of recent post thumbnails is a common header or sidebar feature. Here is an efficient WP_Query version, and the block editor way to build it without code.

Swapping two columns looks like a one-liner, but MySQL evaluates assignments left to right, so the obvious query copies one column over the other. Here is a version that really swaps.

Clients often want their own logo in the WordPress toolbar. You can swap the icon with a few lines of CSS, or remove the WordPress menu entirely and add your own item.

Frameworks like CakePHP and Laravel use bracketed field names that look awkward in jQuery Validation rules. Here are three clean ways to validate those fields.

jQuery never returns null, so this error means $ belongs to something else, often Prototype or the browser console. Here is how to confirm that and fix it.

Colorbox puts its close button at the bottom by default. A small CSS override moves it to the top right. If you are starting fresh, the native dialog element may be all you need.

When editors paste a video link into a custom field, WordPress can turn it into a player. Here is how, why you should cache the result, and why the_content is the wrong tool.

WordPress has a built-in database repair screen, but it is open to anyone while enabled. Here is how to use it safely, the WP-CLI alternative, and the cleanups that actually help.

In Magento 2 you get a category's products through a product collection filtered by category ID, or through GraphQL. Here are both, and why the old Mage:: code no longer applies.

Online PHP beautifiers were handy in 2011. Today a command-line fixer formats a whole project to a standard in seconds, and your editor can run it on save.