Custom post types in WordPress are a great way to add and structure content to a website. Unlike a page however, custom post types cannot have a parent page assigned to them, at least not directly. This could be a major drawback if you want to have a custom post type nest under a specific page in menus and in the URL. more…
Scroll to an Element With Anchor Id After Loading the Page Using jQuery
Most all modern browsers contain the functionality to open a page at a certain anchor element on the page when loaded with a hash element in the link. For example, a link to http://www.mysite.com/#super-element would open the page and display the element with the id=”super-element” attribute. more…
Force Password Complexity Requirements in WordPress
By default WordPress does not require strong or complex passwords but it is easy to add the functionality. Here is a great article explaining why strong passwords are so important. more…
Change the WordPress User Registration Welcome Email
When a user registers on your WordPress site or you create a user manually in wp-admin an email is sent automatically. In many cases this email will not be adequate; you may want to add a link, customize some of the copy, or create an HTML email with images. more…
Force URLS to use HTTP or HTTPS in Symfony 2
Using spl_autoload_register to Load All Classes in a PHP Project
If you have a several classes in your PHP project then you already know how annoying it can be to constantly include the class files before instantiating your class. more…
Create a Custom Page Link Sidebar Widget for WordPress
Creating a custom widget in WordPress is pretty easy and is a great way to allow users to modify their sidebar content. In this example we’ll create a widget that displays some copy and then renders a link to another page on the site. If you’re unfamiliar with WordPress widgets, the Widgets API Codex Reference is very helpful. more…
Modify a WordPress Custom Post Type Configuration After it has Been Registered
I came across a situation today where a plugin had registered a custom post type and I needed to change some of that configuration, namely I wanted to exclude the post type from search results. The solution is pretty simple. more…
Format the Created At Date in Twitter’s REST API
The Twitter REST API returns a created_at date with each API call as part of the JSON response. The problem is that the date returned is not a standard format nor is it in a format that is pleasing or useful in most circumstances. more…
Update URL Rewrite Rules in WordPress
Rewriting Basics
URL rewriting is the process of creating a URL that is friendly for users to look at, type, and share and is usually referred to as a pretty URL. URL rewriting allows you to take query parameters and add them to the URL instead of after the ? in the URL. more…