WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a custom post type "Events" and added the categories function for it. However, the categories only shows in the backend CMS which I can set and add new categories, but no message indicating the category that a event was set for in the front end webpage.

How can I make the events categories information shown in the front end webpage?

I have copied the code below:

function enable_event_posttype() {
    register_post_type( 'events',
            'labels' => array(
                'name' => __( 'Events' ),
                'singular_name' => __( 'Event' ),
                'add_new' => __( 'Add New Event' ),
                'add_new_item' => __( 'Add New Event' ),
                'edit_item' => __( 'Edit Event' ),
                'new_item' => __( 'Add New Event' ),
                'view_item' => __( 'View Event' ),
                'search_items' => __( 'Search Event' ),
                'not_found' => __( 'No events found' ),
                'not_found_in_trash' => __( 'No events found in trash' )
            'public' => true,

                'supports' => array( 'title', 'editor', 'comments'),
            'capability_type' => 'post',
            'rewrite' => array("slug" => "events"), // Permalinks format
            'menu_icon' => get_bloginfo('stylesheet_directory') . '/images/date.png',  // Icon Path
            'menu_position' => '5'

add_action( 'init', 'enable_event_posttype' );

add_action( 'init', 'build_taxonomies', 0 );

function build_taxonomies() {
  register_taxonomy( 'categories', 'events', array( 'hierarchical' => true,  'label' => 'Categories', 'query_var' => true, 'rewrite' => true ) );
share|improve this question

It seems like you got a permalink conflict. You can't give two "things" the same slug/URi in WordPress. Please try it with a different slug than events either for the custom post type or the custom taxonomy.

And yes, I know, this answer will be flagged as "low quality" due to its length.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.