Hey guys, I know pretty much nothing about PHP and I've used internet tutorials and copy n pasting to make a 'video' option for my site. I've tried to make it have their own categories, which I can select and choose when creating a post. But they aren't visible on the post screen or on the website itself?
function my_custom_post_videos() {
$labels = array(
'name' => _x( 'videos', 'post type general name' ),
'singular_name' => _x( 'video', 'post type singular name' ),
'add_new' => _x( 'Add New', 'video' ),
'add_new_item' => __( 'Add New Video' ),
'edit_item' => __( 'Edit Video' ),
'new_item' => __( 'New Video' ),
'all_items' => __( 'All Video' ),
'view_item' => __( 'View Video' ),
'search_items' => __( 'Search Video' ),
'not_found' => __( 'No video found' ),
'not_found_in_trash' => __( 'No videos found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Videos'
);
$args = array(
'labels' => $labels,
'description' => 'All the videos from Geeking It Up A Notch',
'public' => true,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
'has_archive' => true,
);
register_post_type( 'videos', $args );
}
add_action( 'init', 'my_custom_post_videos' );
function my_taxonomies_videos() {
$labels = array(
'name' => _x( 'Videos Categories'),
'singular_name' => _x( 'Video Category', 'taxonomy singular name' ),
'search_items' => __( 'Search video Categories' ),
'all_items' => __( 'All video Categories' ),
'parent_item' => __( 'Parent video Category' ),
'parent_item_colon' => __( 'Parent video Category:' ),
'edit_item' => __( 'Edit video Category' ),
'update_item' => __( 'Update video Category' ),
'add_new_item' => __( 'Add New video Category' ),
'new_item_name' => __( 'New video Category' ),
'menu_name' => __( 'Video Categories' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
);
register_taxonomy( 'videos_category', 'videos', $args );
}
add_action( 'init', 'my_taxonomies_videos', 0 );
[Please use the code buttons, NOT blockquote when posting code]
That's the code I'm using. If someone could help me I'd be very grateful.