Adding tags and categories to a page in WordPress

By default pages in WordPress do not have the ability to use WordPress tags. Too bad — I needed that for my portfolio web page. After I examined I found the solution how to enable tags for all my pages.

Simple write this line to functions.php.

if(!function_exists('addPageTags')){
function addPageTags(){
    register_taxonomy_for_object_type('post_tag', 'page');
}
add_action('admin_init', 'addPageTags');
}

Additionally there is a similar way to add categories for the WordPress pages. Again the simple as adding 1 little function to your functions.php file.


if(!function_exists('addPageCategories')){
function addPageCategories(){
    register_taxonomy_for_object_type('category', 'page');
}
add_action('admin_init', 'addPageCategories');
}

Now even for the pages you will have these two guys:

tags: & category: -