WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 28 of 36

WordPress Conditional Do Shortcode

Quick snippet to call and evaluate WordPress shortcodes conditionally, outside of their normal Post/Page context.

Print this JavaScript

You know those “Print this page” links that let you print the whole page? Yeah, those. Here is how to create one of those for your web page using JavaScript and HTML.

Disable theme switching

By default WordPress enables users to switch themes while working in the Admin area. Sometimes a user might screw this up and accidentally activate the wrong theme.

Display PHP + server info

Quick snippet today meant as a copy/paste template for displaying your PHP and server information in the blink of an eye.

jQuery Preview Selected Images

This jQuery script displays a live preview of the currently selected images, as selected from a file input field.

Add Tweet-this with jQuery

Quick jQuery snippet today for adding a “Tweet this” button for all of your site’s pages. You can see a demo here at WP-Mix (lower-right corner).

Display short URLs in WordPress

Quick tip for the day: display short URLs using native WordPress functionality.

Find All URLs in a String with PHP

While developing my WordPress chat plugin, SAC Pro, I needed a way to get all URLs from a string. This enabled me to find any URLs that were included in chat messages, so I could apply HTML formatting and convert the raw URLs into actual clickable hyperlinks.

Instant screenshots of any web page

Here’s a trick to instantly generate a screenshot of anything on the Web. Without a plugin.

Remove sub-menus

Quick snippet for removing or disabling WordPress sub-menus:

WordPress Navigation Links for Monthly Archives

Archives that are easy to navigate make your WordPress-powered site that much more awesome. There are plenty of great strategies for increasing the usefulness of your post archives. For example, this quick tutorial provides some custom functions that display monthly navigation links. So you can display “Previous Month” and “Next Month” links on monthly archive […]

Create WordPress widgets

WordPress makes it drop-dead simple to create your own custom widgets.