Popular Posts
All posts ordered by popularity
Customize WordPress Allowed Tags for Comments
By default, the WordPress comment form enables users to include basic HTML tags in their comments. This includes tags like <p></p>, <br />, <strong></strong>, and so forth. These basic tags suffice to add basic formatting in most cases. But for some setups, more tags may be needed.
Post format archives
The Post Format Archives Widget makes it easy to link to your custom-formatted posts. Here is a snippet for conditionally displaying their respective archives.
WordPress Require User Login
This post shows a quick and easy way to require that the user is logged in to WordPress in order to gain access to some private content.
WordPress Cron Tips
Here are some quick tips for working with WordPress Cron. The trick to using the scheduling functions is to get the next scheduled cron using wp_next_scheduled().
Replace contenteditable with textarea
Working on my WordPress plugin, Dashboard Widgets Suite, I needed a solid way of replacing contenteditable with a textarea on form submit. Here is a simple solution along with some bonus notes on dealing with certain HTML tags.
WordPress template_redirect Example
Quick code snippet showing basic use of the WordPress template_redirect action hook. This is provided as a quick copy/paste reference for WordPress developers. This hook is useful for customizing any functionality requiring full query information.
Use WP functions outside of WordPress
Here’s how easy it use to use any of WordPress default functionality from any PHP file outside of the WordPress installation directory.
Recursively display images via PHP
Here is an easy way to display all images in a directory — including images contained in sub-directories.
PHP check if file exists by URL
This quick PHP snippet can be used to check if a specific URL exists. I use this in one of my projects for checking the existence of a robots.txt file on the site. Can be modified to check for files on any publicly accessible site.
.htaccess for cookie-less image domain
Here is a choice collection of .htaccess directives that I use when hosting images on a subdomain. When doing so, it’s best for performance to make sure the domain or sub-domain is “cookie-less”, so there is no time wasted sending cookie data back and forth between the server and client. Other optimizations are included to […]
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: Get Current URL and Slug
Another essential tool for your WordPress development toolbox is getting the URL of the current page. This sounds simple but can be tricky depending on which page or type of page is being displayed. So to help, here is a simple technique to get the current URL for any single post, archive view, custom template, […]