WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 4 of 31

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 Detect All Versions of IE

Quick code snippet for detecting all versions of good ’ol IE (Internet Explorer).

Shortcut to WP Login

Back in January of 2011, Chris Coyier posted a sweet .htaccess technique for setting up Simpler Login URLs in WordPress. This is a follow-up technique that’s slightly improved..

WordPress Do Stuff on First User Login

Here is a code snippet that runs the first time a user logs in to their registered account. Useful for sending custom welcome emails, or whatever.

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 Get Category ID from Slug

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

WordPress enqueue user-agent stylesheets

WordPress makes it clean and easy to enqueue custom stylesheets via the functions.php file. Here’s how to do it for user-agent stylesheets.

Difference between home.php & front-page.php

This article explains the difference between WordPress’ home.php and front-page.php theme templates, as related to the display of your site’s front page. For best results, log in to the Admin Area of your WP installation and follow along with the text.

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..

Remove ‘Private’ from private post titles

By default, WordPress prepends the string “Private: ” to all posts marked as “private”. Here’s a quick function to remove the private prefix and move on with your life.

Remove the date from WordPress permalinks

With the rise of the “short URL”, including the date in URLs is no longer considered “cool”, so you may want to “get with it” and dumb down your WordPress URLs to make them shorter. Here is how to use .htaccess to remove the date from your WordPress permalinks.

PHP: Get current URL

Nice lil slab of PHP to get the current URL. Useful for a wide variety of applications, nice one to have in the tool belt.