nationalarchives / tna-child-about-us-research

TNA Child theme for the used for the open access repository
0 stars 1 forks source link

Categories need to be enabled for pages on the site #3

Closed grange85 closed 8 years ago

grange85 commented 8 years ago

This is so that we can use the category specific features such as hiding pages from menu.

We do this on TNA using a plugin but it isn't necessary and I'm looking to remove the plugin completely as this can be done with about five lines of code in functions.php

function enable_categories_on_pages() {
    register_taxonomy_for_object_type('post_tag', 'page'); 
    register_taxonomy_for_object_type('category', 'page');  
}
add_action( 'init', 'enable_categories_on_pages' );
punalsc commented 8 years ago

I'v pasted in the code above, and now merged into develop.

grange85 commented 8 years ago

Thanks @punalsc