WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 32 of 36

WordPress Create Shortcode

Ultra-quick guide to help you create a WordPress Shortcode. Aimed at experienced WordPress users who need a basic example of how to create shortcodes.

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.

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.

WordPress: Add “View HTML” Button on Edit Post Screen

On a recent project, I found myself viewing the HTML source for every post and page on a WordPress-powered site. After about a thousand clicks, I decided to write a code snippet that adds a “View HTML” button (it’s actually just a link) for each post row displayed on the WordPress “Edit Post” screen. So […]

Block Multiple IP Addresses from Text File with PHP

Here is a fun little tutorial. It shows how to block multiple IP addresses that are listed in a plain text file. It’s a nice little system to block bad IP addresses without using any database. For example, this is useful if you’ve got a bunch of IP addresses that you want to block quickly. […]

Check for PHP cURL

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

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 […]

WordPress Display Plugin “View Details” Screen

Everyone is familiar with the WordPress Plugins screen. Where you can view all installed/active plugins, etc. On that screen, there is a link next to each plugin that says “View Details”. When you click it, a popup dialog overlays the page content. Inside of that dialog is a tabbed interface where you can learn about […]

PHP: Remove Empty File Data

This quick function does one simple thing. It removes empty file data from a PHP files array. As you may know, the structure of the $_FILES array is sort of backwards from what normally would be expected. Because of this, removing empty file data from the array requires some extra wrangling. So to make things […]

Simple Ajax Chat Test Script

When testing my plugin, Simple Ajax Chat (SAC), I use the following script to save time testing various chat functionality. Posted here in case it’s useful for others. Note this is for the free version of SAC. Enjoy!

Some Useful WordPress Shortcodes

Here is a nice collection of useful WordPress shortcodes, including cool functionality like displaying author lists, automatic links, subscribe links, current date, and more!

Set Firmware Password on macOS

Own a Mac? Prevent thieves from wiping your hard drive by setting a firmware password. Especially useful if running any sort of anti-theft or tracking app. Setting a firmware password for macOS is straightforward, requiring only three steps.