WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 17 of 36

Using WordPress Filter and Action Hooks

In this tutorial, we have two quick examples showing how to use WordPress filter and action hooks. First we’ll look at how to use filter hooks, and then action hooks.

Another WordPress Cron Example

Here is another WP Cron example for my previous article on WP Cron tips.

jQuery browser detection

Here’s a tasty little snippet for adding custom browser classes using jQuery.

HTML frames template

Every blue moon you need to work with frames. Here is a quick frames template to get you going.

.htaccess enable compression

Two quick code snippets for compressing your file output with Apache’s mod_deflate (gzip). Compressing your content is a great way to improve performance by decreasing the amount of data that is sent to the client.

PHP: Two Ways to Check if Remote File Exists

Working on my free WordPress plugin, Simple Download Counter, I needed a quick way to check if a remote file exists. As in, requesting the file returns a 200 “OK” response. Here are a couple of ways to do it via PHP.

Limit Characters in WordPress Navigation Links

Here is are two jQuery techniques to limit the number of characters in a string, applied to WordPress navigation links.

Traceroute tip

Quick tip for diagnosing traffic and network issues with the traceroute command.

PHP Send Bulk Emails from Text File

This post provides a couple of PHP code snippets that enable you to send emails from a text file. Send in plain-text format and plain-text with embedded image.

Image Gallery

Check out a live demo of a responsive, grid-based image gallery.

Simple Ajax Chat .htaccess whitelist

In general, chat scripts are huge targets for malicious activity. My chat plugin, Simple Ajax Chat is no exception, and includes strong security measures to protect against attack. Aimed at the free version of SAC, this quick tutorial shows a simple Apache/.htaccess technique to further strengthen plugin security.

WordPress Limit Post Display to Post Authors

Here is a good, WP-API method of limiting post display to the currently logged-in post author (i.e., so users can only view their own posts). Here you’ll find two variations of this technique. The first limits the display of posts for non-admin users only. The other limits the display of posts for all users, including […]