Custom post stype
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Książki', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Książk', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Książki', 'text_domain' ),
'parent_item_colon' => __( 'Rodzic', 'text_domain' ),
'all_items' => __( 'Wszystkie', 'text_domain' ),
'view_item' => __( 'Zobacz książkę', 'text_domain' ),
'add_new_item' => __( 'Dodaj nową', 'text_domain' ),
'add_new' => __( 'Dodaj nową', 'text_domain' ),
'edit_item' => __( 'Edytuj', 'text_domain' ),
'update_item' => __( 'Zaktualizuj', 'text_domain' ),
'search_items' => __( 'Szukaj', 'text_domain' ),
'not_found' => __( 'Brak', 'text_domain' ),
'not_found_in_trash' => __( 'Nie znaleziono nawet w koszu!', 'text_domain' ),
);
$args = array(
'label' => __( 'books', 'text_domain' ),
'description' => __( 'Książki', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => false,
'show_in_admin_bar' => false,
'menu_position' => 5,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'books', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type', 0 );