Category: Blogging

WordPress: new Custom Post Type returning 404

I added a custom post type to a WordPress website that I’m building and created two new posts using the custom post type. When I went to view them, I got a 404 error.

Create the custom post type:

add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'campus_advisory',
'labels' => array(
'name' => __( 'Campus Advisories' ),
'singular_name' => __( 'Campus Advisory' )
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'advisory')

Did a bit of searching around and learned that after you create a custom post type, you need to visit the Permalinks page in the WordPress back-end (Settings > Permalinks). I clicked “Save” (even though I didn’t change anything on the page) and refreshed the custom post and it returned the post rather than a 404.

One step further, and I didn’t have to go this far, but folks that visited the Permalinks page and that didn’t fix their 404 error, they had to add
after calling register_post_type in their custom post type code snippet in functions.php (or custom_functions.php if you’re using the Thesis framework—the site I’m currently developing uses the Thesis framework).

Follow up to WordPress 3.3

Just started truly exploring but 2 immediate favs:
1) Drap and drop media uploader. Hot stuff. Also, the uploader no longer designates certain icons for certain file types; it’s all a single icon and after you drag&drop, WordPress does the thinking for you.

2) Comments interface. It could possibly just be the styling of comments in the WordPress twenty-eleven theme, haven’t checked in other themes yet, but I really like it.