WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 31 of 35

WordPress Post Navigation Enlightenment

For some reason, I am fascinated by how post navigation is handled by WordPress and others CMSs. For example, what is the correct order of the “previous” and “next” post-navigation links? Is it different for single posts versus archive views? Should the arrow point right or left? And so forth. After pondering these questions periodically […]

PHP foreach loop

I am always using this PHP code snippet, which basically loops through an array that may or may not include nested arrays. So to make things easier, I am posting here for quick reference.

Check for PHP cURL

Quick snippet for checking whether or not PHP’s cURL is available on the server.

Over 300 SQL Code Snippets for WordPress

I’m excited to launch my latest book, Wizard’s SQL Recipes for WordPress. Years in the making, Wizard’s SQL Recipes brings together over 300 recipes for managing and optimizing the WordPress database. If you’re a WordPress administrator or developer who wants to level up their database skills, this book’s for you. Check out the PDF Demo […]

Apache Require HTTP 1.1 for POST Requests

A reader recently asked how to limit POST requests to only HTTP 1.1. Well here is an .htaccess snippet that will do it.

WordPress Functions for Theme Testing

Some quick copy/paste snippets taken from my dev/test theme, Introspection. Posting them here for reference so I can grab ’em as needed.

WordPress: Simple Image Upload with jQuery

Some of my free WordPress plugins enable users to select and upload files from their local machine. The uploaded images are handled by WordPress and added to the Media Library. The technique is very basic and easy to implement, requiring only a few snippets added to your WordPress site.

How to change your theme’s appearance

If you want to change certain aspects of your theme, you should get familar with its different files.

Dead Simple Tooltips

Finding a decent tooltip script takes a lot of work, searching, testing, fiddling. Often, it’s much quicker and easier to simply roll your own, maybe starting from something very basic and simple. The problem is that finding a super simple starting point for tooltips is next to impossible; the few scripts that are available aren’t […]

Quick KB/MB unit conversions

Working with .htaccess for stuff like file uploads, it’s frequently necessary to convert between kilobytes and megabytes.

Specify images for web pages

This is a general technique for specifying an official image for your site, without actually displaying it on the front-end. Useful for catch-all social-media purposes.

Reset password via SQL

Quick tip o the day! Here’s how to reset your password using a simple SQL query.