WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] post type not supporting tags (2 posts)

  1. nadine00
    Member
    Posted 2 years ago #

    I would like the site's default tags to show up in this custom post type. Any suggestions on why this is not working? do I need to do some kind of register function? am I missing a step?

    <?php
    // adding a custom post type for news
    add_action('init', 'news_register');
    
    	$labels = array(
    			'name' => _x('News', 'post type general name'),
    			'singular_name' => _x('News', 'post type singular name'),
    			'add_new' => _x('Add New', 'News'),
    			'add_new_item' => __('Add New News'),
    			'edit_item' => __('Edit News'),
    			'new_item' => __('New News'),
    			'view_item' => __('View News'),
    			'search_items' => __('Search News'),
    			'not_found' =>  __('No news found'),
    			'not_found_in_trash' => __('No news found in the Trash'),
    			'parent_item_colon' => '',
    			'parent' => __( 'Parent News' ),
    			'public' => true
    			);
    
    		$args = array(
    				'labels' => $labels,
    				'public' => true,
    				'publicly_queryable' => true,
    				'show_ui' => true,
    				'query_var' => true,
    				'has_archive' => true,
    				'rewrite' => array('slug' => 'news'),
    				'capability_type' => 'post',
    				'menu_position' => null,
    				'supports' => array('title','editor','author','excerpt','thumbnail'),
    				'taxonomies' => array('post_tag')
    			  );
    
    		register_post_type( 'news_listing' , $args );
    
    ?>

    If it makes a difference any custom taxonomies I have are registered like so, so I can use them across multiple post types:

    register_taxonomy('locations',array('program_listing','event_listing'),array(
    	      'hierarchical' => false,
    	      'labels' => $labels,
    	      'show_ui' => true,
    	      'update_count_callback' => '_update_post_term_count',
    	      'query_var' => true,
    	      'rewrite' => array( 'slug' => 'location' ),
    	      'single_value' => true
    	    ));

    Maybe I have to do something similar for just default tags?

    Thanks

  2. nadine00
    Member
    Posted 2 years ago #

    Found it.

Topic Closed

This topic has been closed to new replies.

About this Topic