WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've multiple meta boxes for my main/default post types.

I also have multiple post_types where this meta boxes make no sense.

Can you hint me on if/else function I would use on displaying meta boxes only on default post_type?

share|improve this question
How did you add these meta boxes? codex.wordpress.org/Function_Reference/add_meta_box Take a look at the 3rd argument – janw Oct 12 '12 at 7:23
@janw I have working meta box system, just need to limit it. – Sandro Dzneladze Oct 12 '12 at 7:34
Which one? There must be an option to set post type. – Miha Rekar Oct 12 '12 at 7:39
@SandroDzneladze I understand the question, but depending on the plugin/code the means to fix may be different. – janw Oct 12 '12 at 9:16

If you're using add_meta_box, the 4th paramater should be what you're looking for.

add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );

Use http://codex.wordpress.org/Function_Reference/add_meta_box as a reference

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.