Skip to content

Instantly share code, notes, and snippets.

@rsharrer
Created September 26, 2013 13:36
Show Gist options
  • Save rsharrer/6714292 to your computer and use it in GitHub Desktop.
Save rsharrer/6714292 to your computer and use it in GitHub Desktop.
WP-Functions /Add Categories and Tags to the Pages
function add_cat_tag_page() {
add_meta_box('tagsdiv-post_tag', __('Page Tags'), 'post_tags_meta_box', 'page', 'side', 'low');
register_taxonomy_for_object_type('post_tag','page');
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box','page','side','core');
register_taxonomy_for_object_type('category','page');
}
add_action('admin_init','add_cat_tag_page');
function page_tag_cat_request($q) {
if (isset($q['tag']) || isset($q['category']))
$q['post_type'] = array('post','page');
return $q;
}
add_filter('request','page_tag_cat_request');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment