WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 7 of 17

WordPress Functions for Theme Testing

Some quick copy/paste snippets taken from my dev/test theme, Introspection. Posting them here for reference so I can grab ’em as needed.

Simple Ajax Chat: Auto-Clear Chats

This tutorial explains how to hook up automatic clearing of chat messages with my WordPress plugin, Simple Ajax Chat. Note that this tutorial is for the free version of SAC.

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.

Difference between home_url & site_url

Here are some notes to help discern the subtle (and oft-confusing) differences between the WordPress functions, home_url and site_url (and their related “get” functions, get_home_url and get_site_url). We’ll look at the output of these functions and how they relate to the WordPress General Settings.

WordPress Basic Allowed HTML for wp_kses

Here is a function that I use in my plugin, Dashboard Widgets Suite. It provides a sane, practical set of HTML tags and attributes for WP’s wp_kses family of functions.

WordPress Dismissible Admin Notice

Here is an easy snippet for adding a dismissible admin notice to any theme or plugin.

WordPress widget_init not working

Working on USP Pro, I noticed that the included Form Widget stopped working. It didn’t display at all, like it wasn’t even registering with WordPress. After some investigating, I discovered that changes in the WordPress core required an update to the widget code. This article explains the process of troubleshooting and the working solution.

WordPress Example Child Theme

Here is a ready-to-go example Child Theme that you can download and use on your own WordPress-powered site.

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 s2member PayPal Fix

For those using s2Member and getting no response after clicking the “Continue” button on the PayPal.com site, here is a quick possible solution.

WordPress Display Version Number

Here is a simple function to display the current version number for WordPress.

Difference between home.php & front-page.php

This article explains the difference between WordPress’ home.php and front-page.php theme templates, as related to the display of your site’s front page. For best results, log in to the Admin Area of your WP installation and follow along with the text.