How to add categories for pages only?

Question

I have added this function in my functions.php file to show category option for wordpress pages. It works fine.

function support_category_for_pages() {  
    // Add category support to pages
    register_taxonomy_for_object_type('category', 'page');  
}
add_action( 'init', 'support_category_for_pages' );

But is it possible to show/limit some categories for pages only(they must not appear under posts) ?

I hope I am writing this correctly. Basically the requirement is to keep different categories for post & pages and they should not appear in each other’s category option.

0
, rahul 5 months 0 Answers 59 views 0

Leave an answer