WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 4 of 32

Font Smoothing in Chrome & Firefox

Working with text in Chrome (and other Webkit-based browser) and Firefox can be frustrating. Depending on context, certain fonts may be displayed weird: too heavy, too fat, too thick, and so forth. So much so that the text can look distorted and difficult to read. Fortunately, we can apply the CSS font-smoothing property to make […]

PHP Compress CSS & JavaScript

Quick snippets for compressing CSS and JavaScript with PHP’s ob_gzhandler, which will gzip or deflate content depending on browser support.

PHP Get Server Information

Here are some scrap PHP scripts leftover from my work on Dashboard Widgets Suite. These functions were considered specifically for use with the System Information Widget, and provide a variety of details about the current server configuration and software setup.

WordPress Shortcode Display Search Form

Here is an easy custom WordPress function to display your theme’s search form via shortcode. This makes it easy to display the search form on any Post or Page.

CSS select all except last child

Blazing fast snippet for you today: how to select all children except the last child. Targeting HTML with CSS has never been so much fun..

WordPress Get Category ID from Slug

Quick WordPress snippet for getting the category ID from the category slug.

Display all images attached to post

Another technique for working with WordPress attachments, here’s how to display all images that are attached to the post, either before or after the existing post content.

Block XSS with .htaccess

Quick snippet today that you can add to your .htaccess file to block some common XSS (cross-site scripting) attacks.

PHP Add and Remove Query String Variables

Two quick functions, one for adding a query string variable and another to remove a query string variable. Either of these functions can be used in any PHP script to modify query-string parameters.

Getting Path Info with PHP and WordPress

Massive round-up of PHP and WordPress techniques for getting various directory and file path information. This is a mega-reference aimed at PHP/WordPress developers.

.htaccess Force GET or POST Requests

Here is how to force all HTTP requests to be either GET or POST. Easy to modify technique can be used for other types of requests as well.

WordPress Create Upload Files and Directories

This tutorial explains how to create new files and directories in the WordPress /uploads/ folder.