Created
April 20, 2015 09:28
-
-
Save dendeffe/501439dbf7f60ecefa7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add tag support to pages | |
function tags_support_all() { | |
register_taxonomy_for_object_type('post_tag', 'page'); | |
register_taxonomy_for_object_type('post_tag', 'defunktnuvideos'); | |
register_taxonomy_for_object_type('post_tag', 'defunktnuteam'); | |
register_taxonomy_for_object_type('post_tag', 'defunktnutestimon'); | |
register_taxonomy_for_object_type('post_tag', 'defunktnucourse'); | |
register_taxonomy_for_object_type('post_tag', 'defunktnuhorses'); | |
} | |
// tag hooks | |
add_action('init', 'tags_support_all'); | |
add_action('pre_get_posts', 'tags_support_query'); | |
// ensure all tags are included in queries | |
function tags_support_query($wp_query) { | |
if ($wp_query->get('tag')) $wp_query->set('post_type', 'any'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment