0

I'm using following code to register new taxonomy for WP-Post.

function qc22_build_taxonomies(){
        register_taxonomy(__( "fullscreen-tags" ), array(__( "fullscreen" )), array("hierarchical" => true, "label" => __( "Fullscreen Tags" ), "singular_label" => __( "Skill Type" ), "rewrite" => array('slug' => 'fullscreen-tags', 'hierarchical' => true))); 
    }
    function qc22_fullscreen_edit_columns($columns){  

            $columns = array(  
                "cb" => "<input type=\"checkbox\" />",  
                "title" => __( 'fullscreen Item Title' ),
                "type" => __( 'type' )
            );  

            return $columns;  
    }  
    function qc22_fullscreen_custom_columns($column){  
            global $post;  
            switch ($column)  
            {    
                case __( 'type' ):  
                    echo get_the_term_list($post->ID, __( 'fullscreen-tags' ), '', ', ','');  
                    break;
            }  
    }  

    add_action( 'init', 'qc22_build_taxonomies', 0 );
    add_filter("manage_edit-fullscreen_columns", "qc22_fullscreen_edit_columns");  
    add_action("manage_posts_custom_column",  "qc22_fullscreen_custom_columns"); 

I want to appear this taxonomy on WP-Pages also. I'm new to wordpress. Any help will be appreciated.

Thanks

1 Answer 1

1

The second parameter of register_taxonomy can accept a string or an array of post types, so simply add the page post type to that array, like so:

function qc22_build_taxonomies() {
    register_taxonomy( "fullscreen-tags", array( "fullscreen", "page" ), array( "hierarchical" => true, "label" => __( "Fullscreen Tags" ), "singular_label" => __( "Skill Type" ), "rewrite" => array('slug' => 'fullscreen-tags', 'hierarchical' => true ) ) ); 
}
1
  • No problem, didn't realise i was editting when you were also(edit times are close), sorry about that.
    – t31os
    Aug 16, 2011 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.