WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 15 of 36

Replace content in WordPress header.php

Here’s how to filter content in WordPress’ header.php template file using PHP.

Apache Request Method Types

Here is a list of all types of Apache Request methods. GET PUT POST DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK VERSION_CONTROL CHECKOUT UNCHECKOUT CHECKIN UPDATE LABEL REPORT MKWORKSPACE MKACTIVITY BASELINE_CONTROL MERGE INVALID If you know of any others, let me know — thanks! :)

PHP trap for bad bots

Another effective trap for bad bots and spammers, built with PHP and a slice of .htaccess.

jQuery check inline CSS property

Working on my WordPress plugin, Dashboard Widgets Suite, I needed a quick function to check a property defined via the inline style attribute on a specific element. Here is an easy, plug-n-play solution that works great.

Coda 2 Shortcuts

This post is a working roundup of any/all useful shortcuts that I can find for Coda 2 (code editor and FTP software). So far, most of the shortcuts in this post are taken from Brad Strickland’s great post*. So huge thanks to Brad for sharing.

WordPress pre_get_posts example

Here is a quick example showing how to modify the main WP Query (Loop) using the pre_get_posts filter hook.

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.

WordPress: Display All Registered Image Sizes

By default, WordPress generates extra images for each image that is uploaded via the Media Library. These extra images are created in different sizes and are used for different things, like featured images and so forth. In addition to the default generated images, other image sizes may be added via themes and plugins. For example, […]

Cron Notes: Ping External URL with No Output

Working on setting up Cron on ASO server for testing purposes.. just want to ping a URL/file, not save or send any output whatsoever. Here are my notes for future reference.

Simple jQuery tooltip

There are many great jQuery plugins for creating tooltips, but for simple cases only a few lines of code are needed.

Vanilla JavaScript: Focus Input on Page Load

Super quick tutorial today. How to focus the user on any input when the page loads. For example, when you visit the WordPress Login Page, the “Username” field is focused automatically. This technique is very simple and works on any input or element that supports a focused state.

Custom title length

Quick tip for limiting the number of characters displayed in post titles. Limiting title length is useful in some design situations and is actually very easy to do.