Meta box for custom taxonomy

Hi TF people :slight_smile: ,

Could anyone please tell suggest me how to add a meta box to custom taxonomy page?

Thanks a lot in advance.

Alex

Nekto said

Hi TF people :slight_smile: ,

Could anyone please tell suggest me how to add a meta box to custom taxonomy page?

Thanks a lot in advance.

Alex

same way you would for a post, using add_meta_box, and set the post type to your post type, instead of adding post for add_meta_box

chrismccoy said

same way you would for a post, using add_meta_box, and set the post type to your post type, instead of adding post for add_meta_box

Chris, thanks for suggestion, but unfortunately this method won’t do for me.

I would like to add it precisely to the taxonomy page. Let me explain slightly more detail.

For example, I created custom post type “Books” and custom taxonomy “Authors”. How can I add a text field or a file upload field to the add new/edit section of Author taxonomy page for adding photo of book’s author? Just wonder is it possible at all? :slight_smile:

Check this out

Exactly what you need.

Nekto said

Hi TF people :slight_smile: ,

Could anyone please tell suggest me how to add a meta box to custom taxonomy page?

Thanks a lot in advance.

Alex

your question should be " how to add a meta box for custom post type?"

Try this…
first register post type “book”


add_action('admin_init','add_book_meta');
add_action('save_post','update_book_field');
function add_book_meta() {
	add_meta_box('book_details',__('Book Details', 'framework'),'book_field','book','normal','low');

}
function book_field() {
	global $post;
	$text='';
	$custom = get_post_custom( $post->ID );
	if( isset( $custom[ 'text_input' ] [ 0 ] ) ){
		$text = $custom[ 'text_input' ] [ 0 ];
	}
?>

<?php _e('HTML Input fields goes here with custom fields', 'framework');?>

<?php _e('Author Name', 'framework');?> <?php } function update_book_field() { global $post; if( isset( $_POST[ 'text_input' ] ) ) { update_post_meta( $post->ID, 'text_input', $_POST[ 'text_input' ] ); } }

^^^

Guys you should read better… he wants to add fields to the taxonomy page, not to the post types.

In any case, I don’t think there is a proper way to achieve that, but you can check this plugin (just found it) to see which method its author used.

Parker

http://www.deluxeblogtips.com/taxonomy-meta-script-for-wordpress/

Thank you all guys for suggestions!

The problem is solved :slight_smile:

It’s a helping site for me.
thank you

Old Topic