WP-Mix

A fresh mix of code snippets and tutorials

Post format archives

The Post Format Archives Widget makes it easy to link to your custom-formatted posts. Here is a snippet for conditionally displaying their respective archives.

View all WP query variables

Micro Tip for the day: slice of PHP code for viewing all WordPress query variables. Very useful for figuring out custom loops and such.

Additional file-types for mod_expires

Here is a list of the most common file-types for Apache’s mod_expires, which is used for configuring expires headers for better cache control.

Redirect URLs with .htaccess

Here is a quick cheat-sheet for redirecting URLs with .htaccess.

Use your own custom email with Gmail

Quick guide for using your own custom email with Gmail.

Maintenance mode via .htaccess

For WordPress users there are at least three great plugins that make maintenance mode just dead-simple. Even so, here is how to do it with .htaccess.

WordPress 404 email alerts

Here is a customized plug-n-play PHP script for reporting 404 errors via email. No editing required, just clean email alerts for each 404 error.

Protect Plesk stats

An important aspect of website security is protecting sensitive data such as your server statistics. Here is an important security tip for Plesk users.

Create .po templates for WP themes via Poedit

Creating a .po template can be tricky using Poedit, but here are the exact steps that work for me.

Automatic versioning for enqueued stylesheets

Learn how to append the theme version, random number, or both as a query-string parameter to your CSS stylesheet URLs. This is useful for automatic versioning, cache-busting during development, or both.

Break Out of Frames for WordPress

Quick JavaScript snippet to prevent scrapers and turds from framing, defaming, and/or stealing your precious content..

Cron database backups via email

Here’s a simple, effective, and practical way to keep regular backups of your database using cron. After setting up the cron job, backups of your database are sent to you via email.