WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 18 of 36

Create .po templates for WP themes via Poedit

Creating a .po template can be tricky using Poedit, but here are the exact steps that work for me.

WordPress Image Gallery Loop

This post shares the custom-loop code referenced by the image gallery tutorial. Basically what we’re doing here is creating a custom loop for displaying images that are attached to the current post (i.e., in the WP Loop). This technique is used for the Responsive Image Gallery.

Simple email script with PHP

Here is a simple PHP script for sending email.

PHP String Cleaner

Here is a PHP snippet for cleaning or sanitizing variables.

CSS hover link slide-up background

Quick CSS snippet for you, sort of hard to explain but basically it’s an effect whereby the background color slides up when the link is hovered. Keep reading to check out a demo and grab the code.

Monitor File Changes via Cron

Monitoring any changes made to your files is a super-useful security technique. Lots of applications, including forensics, diagnostics, and being cool. Here is a quick way to set it up directly via simple cron job.

PHP Protect Include Files

Including files plays an important role in PHP development. For example, your app may consist of a main plugin file that includes several smaller files, each of which contains some distinct bit of functionality. When including such files, it’s a good idea to protect them against direct access. This tutorial rounds up a bunch of […]

Resize Google Search iframe

I’ve integrated Google Custom Search at DigWP.com and Perishable Press. In doing so, I found it necessary to resize the google-search iframe in order to fit with the responsive layout.

jQuery: Remove parent element containing empty span

This tutorial explains how to remove the parent of an element that contains an empty <span></span> (or any empty element). First I’ll explain where it might be useful, and then share the magical code to make it happen.

Exclude pages from WordPress search results

By default WordPress includes all of your blog’s pages in its internal search results.

Display a Simple “Tweet This” Link

Twitter changes their API quite a bit, however it is still possible to display a simple “tweet this” link anywhere on your web pages.

jQuery switch styles

Switching CSS styles on click (or other event) is easily accomplished with jQuery. Here are two examples showing how to use jQuery to switch styles.