Epistemologist
Epistemologist

Reputation: 1091

How to add Default Post Type “Custom” category to custom post type

Hi I have three custom post types

1- student 2 - teacher 3 - academy

All three types share three categories

1 - subjects 2 - area 3 - qualification level

First I thought I should add all three categories for each post type but I decided to add three categories to default post type and than add these categories to each individual custom post type.

Here is a problem I have successfully added all these categories. When I query categories for custom post type It does show up but when I see number of posts attached to these categories It shows null means these categories are not linked properly with custom post type even though they are added.

Is there anyway to add these categories to all three custom post types or shell I switch to adding all three custom categories for each individual custom post?

Upvotes: 0

Views: 271

Answers (1)

Yamu
Yamu

Reputation: 1662

while registering your custom taxonomy using

<?php register_taxonomy( $taxonomy, $object_type, $args ); ?> 

function make sure you add your custom post types as well in $object_type parameter.For more information see below link:

Link to register custom taxonomy

Upvotes: 0

Related Questions