WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 22 of 36

WordPress Sidebar Template Code

When developing my free WordPress starter theme, I end up with lots of sweet code snippets that for whatever reason didn’t make the final cut. For example, the sidebar template was recently refactored with shiny new code. So what to do with the previous sidebar code? Delete it? Nah, instead I would rather share it […]

Include external, current version of jQuery

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

Disable Chrome XSS Auditor

Working on WordPress development and testing HTML forms in Chrome browser, I ran into the following error: This page isn't working Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards). ERR_BLOCKED_BY_XSS_AUDITOR

WordPress Dismissible Admin Notice

Here is an easy snippet for adding a dismissible admin notice to any theme or plugin.

Spammer Trap

Another bad-bot trap to keep spammers and other scumbags away from your website.

Structure of $_FILES array

Working with USP Pro involves a lot of $_FILES manipulation. I tend to forget how the array is structured, so I’m posting it here for ez reference.

1Password Dropbox Sync

Here is a simple trick for getting your 1Password data file to sync on any device.

PHP fix exif_imagetype() error

Working on my plugin USP Pro, it’s become apparent to me that some servers for whatever reason disable the function exif_imagetype() function. So some users would get an error when trying to upload images. To resolve this, I added the following simple function to the plugin core.

WordPress Comment Anchor Links

Just a head’s up about comment anchor links: they tend to vary a lot from theme to theme, and whether or not there are comments on the post.

HTML5 Starter Template

Ahh yeah, HTML starter templates at your service..

CSS reveal nofollow links

In this quick post, you’ll see how to use CSS attribute selectors to reveal any nofollow links included in your web pages.

PHP run script for specific IP address

When working on a live site (which of course you should never do), it may be useful to execute some PHP script only for your own IP address. This quick tutorial provides a simple script that can make it happen. $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'undefined'; $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'undefined'; $address […]