How to add categories for pages only?


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.

, rahul 2 years 2020-09-03T13:10:22-05:00 0 Answers 59 views 0

Leave an answer