WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 5 of 35

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.

Combine Audio and Video in QuickTime 7

Quick tutorial showing how to combine audio and video in QuickTime 7 on Mac.

Get child or parent theme URI & path

These days, WordPress provides numerous ways to get the path and URI for the current theme directory. This post is reference for WP developers who need to get the URI and/or path for the current child or parent theme. Just grab, gulp, and go..

Infinite loop trap for spammers

In this WP-Mix post, we’ll see how to send spammers on a virtual infinite loop chasing down randomly generated email addresses. It’s very satisfying.

CSS select all except last child

Blazing fast snippet for you today: how to select all children except the last child. Targeting HTML with CSS has never been so much fun..

Chrome Extension Icons Missing from Toolbar

I recently upgraded Google Chrome browser to version 52 point something or other, and noticed that all of my extension icons suddenly were missing from the Toolbar. Apparently Google decided to “hide” them all in the Chrome settings menu.

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.

PHP Compress CSS & JavaScript

Quick snippets for compressing CSS and JavaScript with PHP’s ob_gzhandler, which will gzip or deflate content depending on browser support.

Force Trailing Slash with .htaccess

This quick code snippet enables you to enforce that all directory URLs append a trailing slash. It is a very simple code snippet, only a few lines and done. Here are a few examples to give you a better idea of how it works.

Block XSS with .htaccess

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

Canonical www via .htaccess

Creating canonical URLs for your site is an important part of good SEO. In this quick post, we’ll look at several .htaccess techniques for removing and requiring the www prefix, and additionally we’ll see how to remove any index.php appendage from all URIs.

Share links without sending referrer information

Here is a quick tip for sending links without including any referrer information. I found this service used at WordPress.com.