Created
June 5, 2013 13:21
-
-
Save Clorith/5713806 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function theme_custom_post_type() { | |
$labels = array( | |
'name' => _x( 'Clues', 'post type general name' ), | |
'singular_name' => _x( 'Clue', 'post type singular name' ), | |
'add_new' => _x( 'Add', 'book' ), | |
'add_new_item' => __( 'Add clue' ), | |
'menu_name' => __( 'Clues' ) | |
); | |
$args = array( | |
'labels' => $labels, | |
'description' => 'Clue details page', | |
'public' => true, | |
'menu_position' => 5, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'revisions', 'author' ), | |
'has_archive' => true | |
); | |
register_post_type( 'clue', $args ); | |
} | |
function theme_custom_taxonomy() { | |
$labels = array( | |
'name' => _x( 'Clue categories', 'taxonomy general name' ), | |
'singular_name' => _x( 'Clue category', 'taxonomy singular name' ), | |
'menu_name' => __( 'Clue categories' ) | |
); | |
$args = array( | |
'labels' => $labels, | |
'show_admin_column' => true, | |
'hierarchical' => true | |
); | |
register_taxonomy( 'clues', 'clue', $args ); | |
} | |
add_action( 'init', 'theme_custom_taxonomy' ); | |
add_action( 'init', 'theme_custom_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment