Category Archives: wordpress tips

Custom Post Types and their single view

I’m often making custom post types for my clients.  I think a best practice for custom post types is to ensure there is a single view available so the end-user can view or preview the particular custom post type they are creating or editing.

I’ve encountered on many an occasion that when I go to view the custom post type, I get a 404 error.  I’ve spent many an hour noodling around, clearing the database and other fun means of forcing a round peg down a square hole.

I’ve never really figured it out…till today.  Thank you Google.

I’ve found that if I put this at the end of the function that registers the custom post type and it’s own taxonomy, that things work much better 🙂

flush_rewrite_rules( false );

It’s been a huge time saver for me. Hope that helps someone out there.