WP-Mix

A fresh mix of code snippets and tutorials

WordPress Conditional Shortcodes via Ajax

This example builds from the conditional do_shortcode technique to evaluate shortcodes during Ajax requests.

WordPress Conditional Do Shortcode

Quick snippet to call and evaluate WordPress shortcodes conditionally, outside of their normal Post/Page context.

Auto-Height for Ajax-Loaded Content

Here is a jQuery function for automatically setting the height of Ajax-loaded content.

The Right Way to Include Google Fonts in WordPress

This tutorial explains the right (and wrong) way to include (aka enqueue) Google Fonts in your WordPress theme.

PHP Get Actual IP Address

Here are a couple of quick snippets to get the visitor’s actual IP address via PHP.

Detect Chrome, IE, Firefox, Opera, and Safari

How to detect each of the major browsers (Chrome, IE, Firefox, Opera, Safari) client-side via JavaScript.

Set PHP Limits with .htaccess

A quick summary of some of the PHP limits that can be set via the .htaccess file.

Free Up Server Disk Space

Recently I spent some time clearing up more free space on my server. Here are some notes on things to check when doing so.

Check for PHP cURL

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

Update WordPress Post With Current Time

Here is a simple technique for updating WordPress posts with the current date and time. Useful for timezone/server transfers.

Truncate Database Table

Quick SQL code snippet that enables you to truncate any MySQL database table.

Find duplicate email addresses in WordPress

This tutorial explains how to find duplicate email addresses in your WordPress database. That way you can delete or modify as needed.