title: Adding dropdown selection to WP Custom Post Type
body: <p>I'm trying to add a "Price Range" drop-down selection to the meta box within my custom post type. There would be three options: $ / $$ / $$$</p>
  
  <p>Here's what I'm currently using to create the select box:</p>
  
  <pre><code>&lt;p&gt;
      &lt;label for="price_range" class="prfx-row-title"&gt;&lt;?php _e( 'Price Range', 'prfx-textdomain' )?&gt;&lt;/label&gt;&lt;br/&gt;
      &lt;select type="text" name="price_range" id="website_url" value="&lt;?php if ( isset ( $prfx_stored_meta['price_range'] ) ) echo $prfx_stored_meta['price_range'][0]; ?&gt;" /&gt;
          &lt;option&gt;$&lt;/option&gt;
          &lt;option&gt;$$&lt;/option&gt;
          &lt;option&gt;$$$&lt;/option&gt;
      &lt;/select&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Here's what I'm current using to save the select box:</p>
  
  <pre><code>if( isset( $_POST[ 'price_range' ] ) ) {
      update_post_meta( $post_id, 'price_range', sanitize_text_field( $_POST[ 'price_range' ] ) );
  }
  </code></pre>
  
  <p>The selection box shows up fine in WP, but it won't save my selection when I publish the post.</p>
  
  <p>Lastly, here's what I have to display the price range in my page template(s):</p>
  
  <pre><code>&lt;!-- DISPLAY PRICE RANGE IF ONE EXISTS --&gt;
  &lt;?php if ( get_post_meta($post-&gt;ID, 'price_range', true) ) { ?&gt;
  &lt;strong&gt;Price Range: &lt;/strong&gt;
  &lt;?php $meta_value = get_post_meta( get_the_ID(), 'price_range', true ); // Retrieves the stored value from the database
  if( !empty( $meta_value ) ) { // Checks and displays the retrieved value
  echo $meta_value;
  }
  ?&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>I haven't tested this yet, because I haven't been successful in saving my price range meta – but will this work?</p>