WP-Mix

A fresh mix of code snippets and tutorials

Google Translate in 2 Steps

Follow this simple two-step tutorial to enable users to translate your web pages into many different languages. Great way to increase exposure and traffic.

Include external, current version of jQuery

Quick tip for including (linking to) the current version of jQuery from external sources.

Display Twitter count in plain text

Twitter’s constant changes make it necessary to update techniques for otherwise simple tasks such as displaying your Twitter count via PHP.

Redirect HTTP to HTTPS

In addition to www canonicalization, you can also canonicalize the HTTP protocol, redirecting HTTP to HTTPS (or vice versa) using Apache/.htaccess. Below you will find several ways to force SSL/TLS for all URI requests. This is especially useful for sites with existing links pointing to unencrypted http:// URLs. Enforcing use of SSL/HTTPS helps to eliminate […]

.htaccess for Apple Touch Icons

Devices and bots are often searching for different versions of the Apple Touch Icon. Here is a quick slice of .htaccess to redirect all apple-icon requests to apple.png.

Allow access to external IPs during development

When developing sites, an easy way to keep things private is to use .htaccess to restrict access based on IP address.

Disable or customize WP read more link

Quick snippet for customizing or disabling the WordPress “read more” link for the_excerpt().

Replace content in WordPress header.php

Here’s how to filter content in WordPress’ header.php template file using PHP.

Targeting different versions of IE

Honestly I can’t stand Internet Explorer. But people still use it, so here’s a few ways (via jQuery & CSS) to target different versions of IE.

FeedBurner .htaccess redirect

Need to redirect your feeds to FeedBurner? Here’s how to do it with a thin slice of .htaccess.

Remove www and index.php from URL

Here’s a handy .htaccess snippet for canonicalizing URLs by removing the “www”, “index.php”, and “index.html” from all requests.

jQuery switch styles

Switching CSS styles on click (or other event) is easily accomplished with jQuery. Here are two examples showing how to use jQuery to switch styles.