WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 3 of 30

WordPress Disable REST API Header Links

WordPress 4.4 adds all sorts of new REST API functionality. Which is great if your site is using it. But if not, then you may want to remove all of the extra baggage that WordPress now adds to every page load. This tutorial explains how to disable it.

WordPress Cron Not Working

Some servers disable the functionality that enables WordPress Cron to work properly. This post provides an easy fix that should work on any server.

Require user login for any plugin

Here’s a quick trick to require user-login for any plugin. For example, if you want users to be able to use your chat plugin only if they are logged in. Here’s how..

Display all images attached to post

Another technique for working with WordPress attachments, here’s how to display all images that are attached to the post, either before or after the existing post content.

Tabbed sidebar menu with jQuery

Here’s an clean, simple way to add a tabbed sidebar menu using jQuery. You can see an example in the Introspection WP Theme.

Additional file-types for mod_expires

Here is a list of the most common file-types for Apache’s mod_expires, which is used for configuring expires headers for better cache control.

Block XSS with .htaccess

Quick snippet today that you can add to your .htaccess file to block some common XSS (cross-site scripting) attacks.

jQuery Scroll to Target with Offset

This tutorial shows how to create “scroll-to” links with jQuery. For example, if you want to add a link on your page that smoothly scrolls the user to a specific location, add the following code snippet to your JavaScript file.

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

CSS Style Pre Tags

I enjoy writing about HTML pre tags. In this post, I share some basic CSS to help style your pre tags for both screen and print media.

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 […]

Display category name in WordPress

Here are two snippets for displaying the category name and displaying the category link in WordPress.