Like the blog? Get the book »

Author Profile: Chris Coyier

Custom Post Types in WordPress 3.0

Still confused about these “custom post types”? We already have categories for Posts and we can use various techniques like post_class to target certain posts with CSS and do different styling. We can also use conditionals to treat posts in different categories completely differently. Why is this going to help?

The big difference is that it actually adds sidebar links to the Admin side specifically for these new types. And beyond that, you can actually declare custom data types for different types. Instead of just “Add Post” and “Add Page”, you can have “Add Real Estate Listing”, which only will ask for “Property Name”, “Description”, “Price”, and “Sale Status”. Powerful stuff!

Nice Way to Encourage Plugin Upgrading

Nice Way to Encourage Plugin Upgrading

A while back we talked about upgrading plugins. Specifically the All-in-One SEO pack and the controversy surrounding how it turns it self off after (some) updates. This is what that plugin looks like when it needs an updating:

.net Mag, The web pro’s guide to WordPress

I just got my hands on issue #199 of .net Mag. I did an article for it on WordPress, and it’s on the cover!

Photo of .net magazine

They did use the wrong W for the cover, but I’m sure they got enough flack for it they won’t mess that up again =). This is probably practically an old issue for UK folks, but big bookstores in the U.S. I find do tend to stock this magazine (Sold as “Practical Web Design” in the U.S.) but always a few issues old, so I bet you could find it around about now.

Editor’s note: 404 link removed.

Declare Multiple Widgetized Areas in WordPress

Declare Multiple Widgetized Areas in WordPress

Have a bunch of different areas you wish to declare as a widgetized area? Save repetative code by creating a quick array of their names, then loop through that array calling the register_sidebar() function on each one. Elementary PHP stuff here, but hey, it just saved me quite a few lines of code in a widget-heavy theme I am working on.

WordPress Admin Bookmarklet

Drag to your bookmarks bar, click, get a bunch of buttons for easy access to specific areas of your WordPress admin. No security concerns, other than taking people to your log in page, so assuming you have a good strong password you are fine. Also I suppose this assumes you have WP installed at the root…

5 tips for using AJAX in WordPress

WordPress has a bunch of AJAX abilities built in that you can access, without having to use any outside resources. Gary Cao shows how, pointing out good and bad practices.

Editor’s note: 404 link removed.

Add Classes to post_class

Add Classes to post_class

The post_class() function in WordPress is pretty darn useful. It is used like this, in most templates, in a wrapping div of all the content you are outputting:

WordPress vs. ExpressionEngine: Apples and Oranges?

Marcus Neto attempts to compares the two CMSs while explaining why he likes ExpressionEngine. Are they really apples or oranges? I suppose you could say that. Apples and oranges are both popular spherical fruit. They have more in common than theyhave different. Same with the two CMSs.

While I’m 98% a WordPress guy, there are a few circumstances I might take the EE route, like when:

  1. I knew I was going to need a whole bunch of different custom data types and groups and didn’t feel like dealing with the whole Pods or Flutter setup.
  2. I also knew no newbie client was going to need to get in there.
Shortcodes in Widgets

Shortcodes in Widgets

I had occasion the other day to run a shortcode inside of a text widget. You know shortcodes… we talk about them all the time. They are keywords in [square_brackets] that do something special.

Sometimes they do something really simple like return a string (so you can have a global location to customize some string of text, for example), or they do something more complicated like call a plugin that does something fancy like build a photo gallery.

PubSubHubbub Now On All WordPress.com sites (+ plugin for self hosted sites)

This is me trying to understand it:

Instead of services that read your feeds (e.g. Google Reader) having to ASK for your feed periodically, now they can instead just wait until YOUR SITE notifies THEM. Basically a “push” service.

It seems to me this is half the equation. The other half is building services that accept these push notifications. I’m not sure who is already doing that, but I wouldn’t be surprised if Google is on it, since it seems like a more efficient way of doing things on both sides (less server resources on both sides).

Two concerns I can think of:

  1. Is this just as reliable as the “old” way? People not getting feed updates because of a hiccup in the chain sucks for everyone.
  2. This makes “accidentally” hitting that publish button potentially even more embarrassing than it already can be. Like when you accidentally publish a post instead of a page.

Also check the overview slideshow here.

Add Link to Favorites Dropdown

This is basically a smarter way to handle the situation I just posted about. Using a function to manipulate the favorites dropdown instead of a core hack.

Editor’s note: 404 link removed.

Change Quick Action Button in Admin

Change Quick Action Button in Admin

You know the “quick action” button in the WordPress admin? It’s a darn useful little UI touch. At the Dashboard, the default is “New Post”. But depending on where you are in the Admin, the default of it changes. In general it’s really helpful. For example when you are in the Plugins area, the default is Install Plugins:

Digging Into WordPress v2.0 + Print is Back! (Oh, and a fresh new design!)

Digging Into WordPress v2.0 + Print is Back! (Oh, and a fresh new design!)

Version 2.0 is here! If you have already purchased the book, you have already gotten an email with a link to download the 2.0 version of the book. If you have been waiting for the print version to come back in stock, the time is now!

We sold out of the print version the first round in a matter of weeks. Right about that time, WordPress 2.9 was coming out, so instead of just reprinting more we decided to update the book and print new copies with that fresh information. That is exactly what we have done. The all-new Chapter 11 of the book deals with new stuff in WordPress 2.9 (and how to use the new features). That chapter will also be the home for future version-specific updates to WordPress.

Use BuddyPress, Keep your Theme

If you want to use BuddyPress (a massive plugin that basically adds a social networking layer to WordPress sites, think, forums, profiles, user blogs, etc) but you’ve been hesitant to try it, now is a better time than ever.

BuddyPress 1.2 now works with stand-alone WordPress installs (before you had to use MU) and you can even keep your existing theme.

© 2009–2024 Digging Into WordPress Powered by WordPress Monzilla Media shapeSpace