WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 9 of 35

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

Allowed HTML tags for wp_kses()

Developing WordPress plugins, I frequently need to specify an array of allowed HTML tags and attributes for wp_kses(). The collection of allowed tags has grown over time, and so I’m posting it here at WP-Mix for future reference. Just makes my life easier, hopefully it helps you too.

WordPress Disable Author Archives

This WordPress snippet disables all author-archive views. This may be useful to prevent user enumeration scans, and also may help to minimize duplicate content (for SEO purposes).

WordPress Check User Roles

Here is a plug-n-play function to check user roles, based on an array of input values.

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.

Cross domain posting with Ajax

Technically cross-domain posting is not allowed, but here is a workaround that may prove useful for your brainstorming sessions. Note that this technique is aimed at advanced developers.

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.

jQuery Open Links in New Tab

Over the years, I’ve collected various JavaScript techniques for opening external links in their own tab. Here they are, all in one convenient post..

jQuery Reload Current Page on Click

jQuery makes it easy to do all kinds of cool stuff. For example, here is a code snippet to reload the current page with a click.

Get all meta data for WordPress user

Quick tip to get all meta data for any WordPress user. Warning, arrays ahead..

jQuery Truncate Text

Here are a few choice code snippets to truncate text with jQuery. Useful for fine-tuning responsive layouts, or just truncating strings of text in general.

.htaccess template file for WordPress

By default, WordPress does not require any .htaccess rules to function properly. But if you want to enable pretty permalinks, a simple set of .htaccess rules must be included in your site’s root .htaccess file.