A fresh mix of code snippets and tutorials

Category Archive: WordPress

Posts about WordPress

Page 14 of 16

Secure .svn directories

On most servers, the hidden .svn directories that are used for subversion are hidden and protected by default. If you’re paranoid or unsure of whether or not the svn files are protected automatically, you can use a slice of .htaccess to block all public access.

Deluxe Copyright Dates in WordPress

There are (at least) three ways to display copyright information (date and name) on your WordPress-powered web pages.

Advanced search for custom post types

Setting up custom search forms for custom post types can be tricky business. Here’s a quick & easy guide to make it happen in two steps.

Get the Current URL in WordPress

Quick tip: get the current URL in WordPress:

Update WP plugins via Mac Terminal

Here’s a quick guide for updating your WordPress plugins in the Plugin Directory using Mac Terminal.

Display a custom gravatar in WordPress

Using your own custom gravatars (aka avatars) in WordPress is a piece of cake.

Note about date and time

Just a quick note about how WordPress handles dates and times.

Display all comments on separate page

Normally WordPress themes display comments on the same post or page. WordPress makes it possible to page the comments, so that there are only so many per page, but by default it’s not possible to display all comments on a separate page. Here’s how to do it in three easy steps.

Remove the date from WordPress permalinks

With the rise of the “short URL”, including the date in URLs is no longer considered “cool”, so you may want to “get with it” and dumb down your WordPress URLs to make them shorter. Here is how to use .htaccess to remove the date from your WordPress permalinks.

Query custom post types

Here’s how to query custom post types with WordPress 3 and better.

Publish a post via functions.php

Normally users create new posts from the Posts Edit screen in the WordPress Admin, but you can also publish posts from the functions.php file.

Disable theme switching

By default WordPress enables users to switch themes while working in the Admin area. Sometimes a user might screw this up and accidentally activate the wrong theme.