Support » Fixing WordPress » Custom Post Types and Registering Tags

  • voodoomg

    (@voodoomg)


    I am currently using a theme which has a Custom Post Type set up (portfolio posts) but the Tag function is not registering. I have tried some of the suggested techniques but all break the code.

    Currently:

    //Let's create out Custom post Types & taxonomies
    	add_action('init', 'timelessCustomPortfolioType');
    	add_action('init', 'timelessPortfolioCustomTaxonomy');
    
    	function timelessCustomPortfolioType() {
    
    		register_post_type( 'portfolio_posts',
    			array(
    				'labels' => array(
    					'name' => __( 'Portfolio Posts' ),
    					'singular_name' => __( 'Portfolio Post' )
    				),
    
    				'public' => true,
    				'menu_position' => 8,
    				'query_var' => true,
    				'supports' => array(
    
    					'title',
    					'editor',
    					'custom-fields',
    					'comments',
    					'excerpt'
    
    				),
    
    				'rewrite' => array(
    
    					'slug' => ddp('portfolio_slug'),
    					'with_front' => false
    
    				)
    			)
    		);
    
    	}
    
    	//ADDS OUR PORTFOLIO CATEGORIES
    	function timelessPortfolioCustomTaxonomy() {
    
    		//Portfolio Categories
    		register_taxonomy(
    
    			'portfolio_cats',
    			'portfolio_posts',
    			array(
    
    				'hierarchical' => true,
    				'label' => 'Portfolio Categories'
    
    			)
    
    		);
    
    	}

    Any thoughts would be greatly appreciated.

  • The topic ‘Custom Post Types and Registering Tags’ is closed to new replies.