Custom Post Types

Apart form the many examples on the internet and elsewhere (for example in WordPress for Web Developers) here are some notes:

– When custom posts don’t show up after creating them, it may help to set the permalinks to default and back again to your preffered setting.

– To change where the custom post type appears in the admin sidebar, set menu-position to one of the following:

  •  5 – below Posts
  • 10 – below Media
  • 15 – below Links
  • 20 – below Pages
  • 25 – below comments
  • 60 – below first separator
  • 65 – below Plugins
  • 70 – below Users
  • 75 – below Tools
  • 80 – below Settings
  • 100 – below second separator

– You can set a menu icon with menu-icon

– Note that public is true by default for taxonomies but is false by default for post types. The query_vars, rewrite, and show_ui attributes all inherit from public, so be sure to set public to true (or turn on each of those items individually).

Including Custom Post Types in Your Theme

As long as the has_archive argument was set to true when the post type was registered, displaying your custom post types in your theme is easy. To create a single archive page for a custom post type, all you have to do is create another file in your theme directory, single-type.php. To create an archive list page for the post type, create a file called archive-type.php.