title: How to add custom field to custom post type?
body: <p>Good morning.</p>
  
  <p>I have created a custom post type called 'Products'. I want to create a custom field (is metabox
  the correct term?) where my client can tick a box to determine whether a given post within this
  CPT is a featured post.</p>
  
  <p>Here is the code in my functions.php to create the 'Products' CPT:</p>
  
  <pre><code>function products_custom_init() {
  
      $labels = array(
          'name' =&gt; _x('Products', 'post type general name'),
          'singular_name' =&gt; _x('Product', 'post type singular name'),
          'add_new' =&gt; _x('Add New', 'products'),
          'add_new_item' =&gt; __('Add New Product'),
          'edit_item' =&gt; __('Edit Product'),
          'new_item' =&gt; __('New Product'),
          'view_item' =&gt; __('View Product'),
          'search_items' =&gt; __('Search Products'),
          'not_found' =&gt;  __('Nothing found'),
          'not_found_in_trash' =&gt; __('Nothing found in Trash'),
          'parent_item_colon' =&gt; ''
      );
  
      $args = array(
          'labels' =&gt; $labels,
          'public' =&gt; true,
          'publicly_queryable' =&gt; true,
          'show_ui' =&gt; true,
          'show_in_menu' =&gt; true,
          'show_in_nav_menus' =&gt; false,
          'query_var' =&gt; true,
          'rewrite' =&gt; array('slug','pages'),
          'capability_type' =&gt; 'post',
          'hierarchical' =&gt; true,
          'menu_position' =&gt; 5,
          'supports' =&gt; array('title','editor','thumbnail','excerpt',)
        );
  
      register_post_type( 'products' , $args );
  }
  add_action( 'init', 'products_custom_init' );
  </code></pre>
  
  <p>So how do I add the 'featured' metabox / custom field to <em>only</em> Products posts?</p>
  
  <p>Many thanks,</p>
  
  <p>Cynthia</p>