If you ever wondered how could you add category and tags to page in WordPress, you will be surprised that solution is just for a couple of lines of code. Just add following code to your theme’s functions.php file and that’s it !

function add_cats_tags_to_page() {  
// Add tag metabox to page
register_taxonomy_for_object_type('post_tag', 'page'); 
// Add category metabox to page
register_taxonomy_for_object_type('category', 'page');  
 // Add to the init hook of your theme functions.php file 
add_action( 'init', 'add_cats_tags_to_page' );

register_taxonomy_for_object_type function adds an already registered Taxonomies to an already registered post type.
First parameter for the function is taxonomy slug which you want to assign to given post type.
Second parameter is post type slug to which you want to assign specific taxonomy.

Add category and tags to page – WordPress
Tagged on:         

One thought on “Add category and tags to page – WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.