Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* ------------------------------------*\
- Custom Post Types
- \*------------------------------------ */
- add_action('init', 'create_post_types'); // Add our Post Types
- function create_post_types() {
- register_taxonomy_for_object_type('category', 'html5-blank'); // Register Taxonomies for Category
- register_taxonomy_for_object_type('post_tag', 'html5-blank');
- register_post_type('galleries', // Register Custom Post Type
- array(
- 'labels' => array(
- 'name' => __('Gallery'), // Rename these to suit
- 'singular_name' => __('Gallery'),
- 'add_new' => __('Add New'),
- 'add_new_item' => __('Add New Gallery'),
- 'edit' => __('Edit'),
- 'edit_item' => __('Edit Gallery'),
- 'new_item' => __('New Gallery'),
- 'view' => __('View Gallery'),
- 'view_item' => __('View Gallery'),
- 'search_items' => __('Search Galleries'),
- 'not_found' => __('No Galleries found'),
- 'not_found_in_trash' => __('No Galleries found in Trash')
- ),
- 'public' => true,
- 'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages
- 'has_archive' => true,
- 'supports' => array(
- 'title',
- 'editor',
- 'excerpt',
- 'thumbnail',
- 'custom-fields',
- ), // Go to Dashboard Custom HTML5 Blank post for supports
- 'can_export' => true, // Allows export in Tools > Export
- 'taxonomies' => array(
- 'post_tag',
- 'category'
- ) // Add Category and Post Tags support
- ));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement