I have created a post type called blogs with categories and a taxaonomy called "blog name"... Posts are showing in categories but in taxonomies posts are not shown.
I am new to taxanomies... I have pasted the code here
function create_post_type_blogs() {
$labels = array(
'name' => _x('Blog Posts', 'post type general name', THEMEDOMAIN),
'singular_name' => _x('Posts', 'post type singular name', THEMEDOMAIN),
'add_new' => _x('Add New Post ', 'book', THEMEDOMAIN),
'add_new_item' => __('Add New Post', THEMEDOMAIN),
'edit_item' => __('Edit Post', THEMEDOMAIN),
'new_item' => __('New Post', THEMEDOMAIN),
'view_item' => __('View Posts', THEMEDOMAIN),
'search_items' => __('Search Posts', THEMEDOMAIN),
'not_found' => __('No Posts found', THEMEDOMAIN),
'not_found_in_trash' => __('No Posts found in Trash', THEMEDOMAIN),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor', 'thumbnail', 'comments','author'),
'taxonomies' => array( 'blogname', 'category', 'post_tag' ),
'menu_icon' => get_stylesheet_directory_uri().'/functions/images/sign.png'
);
register_post_type( 'blogs', $args );
}
add_action('init', 'create_post_type_blogs', 0 );
// Register Custom Taxonomy
function add_taxonomy_blogname() {
$labels = array(
'name' => 'Blog Name',
'singular_name' => 'Blog Name',
'menu_name' => 'Blog Name',
'all_items' => 'All Blog Names',
'new_item_name' => 'New Blog Name',
'add_new_item' => 'Add New Blog Name',
'edit_item' => 'Edit Blog Name',
'update_item' => 'Update Blog Name',
'separate_items_with_commas' => 'Separate Blog Name with commas',
'search_items' => 'Search Blog Name',
'add_or_remove_items' => 'Add or remove Blog Name',
'choose_from_most_used' => 'Choose from the most used Blog Name'
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true
);
register_taxonomy( 'blogname', 'blogs', $args );
}
add_action( 'init', 'add_taxonomy_blogname', 0 );