WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 32 of 36

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

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.

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

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.

CSS Selectors and Default Styles for the WordPress Admin Area

Here are the CSS selectors used by WordPress in the Admin Area. Note that things are changing relatively quickly in the WP Admin Area, so chances are there are additional selectors and styles that have been added, and likely some changes made to the current list. So this collection of default CSS selectors and styles […]

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

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: Customize Read More Links and Text

Here are two code snippets that are useful for customizing the “read more” link. The read more link is displayed on archive views like category archives, author archives, posts archives, search results, and so forth. You also will find the read more link displayed on the site’s homepage and on any page where posts excerpts […]

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!