Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using the following code in functions.php for adding a custom meta box.

The custom post type is themes. I want to add more post types, how can I?

    'Demo & Download', 
share|improve this question
Do you want to add more Custom Post Types or add the same metabox to other post types? –  brasofilo Dec 11 '12 at 2:43
I want to add same meta box to other post types too. –  Ahmad Dec 11 '12 at 2:45

1 Answer 1

up vote 3 down vote accepted

Whenever in doubt about a WordPress function, consult the Codex.

There, you'll see that you need to add one meta box to each post type.

add_action( 'add_meta_boxes', 'myplugin_add_custom_box' );

function myplugin_add_custom_box() {
        __( 'My Post Section Title', 'myplugin_textdomain' ),
        __( 'My Post Section Title', 'myplugin_textdomain' ), 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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