title: How can I make an item show/hide based on a checkbox being checked/not checked?
body: <p>So I created a checkbox on my wordpress theme. everything saves properly and all of that:</p>
  
  <pre><code>    function member_page_featured_meta() {
          add_meta_box( 'member_page_meta', __( 'Is this a Member Page?', 'member_page-textdomain' ), 'member_page_meta_callback', 'page', 'side', 'low' );
      }
      add_action( 'add_meta_boxes', 'member_page_featured_meta' );
  
      /**
       * Outputs the content of the meta box
       */
  
      function member_page_meta_callback( $post ) {
          wp_nonce_field( basename( __FILE__ ), 'member_page_nonce' );
          $member_page_stored_meta = get_post_meta( $post-&gt;ID );
          ?&gt;
  
       &lt;p&gt;
          &lt;div class="member_page-row-content"&gt;
              &lt;label for="featured-checkbox"&gt;
                  &lt;input type="checkbox" name="featured-checkbox" id="featured-checkbox" value="yes" &lt;?php if ( isset ( $member_page_stored_meta['featured-checkbox'] ) ) checked( $member_page_stored_meta['featured-checkbox'][0], 'yes' ); ?&gt; /&gt;
                  &lt;?php _e( 'Yes', 'member_page-textdomain' )?&gt;
              &lt;/label&gt;
  
          &lt;/div&gt;
      &lt;/p&gt;   
  
          &lt;?php
      }
  
      /**
       * Saves the custom meta input
       */
      function member_page_meta_save( $post_id ) {
  
  
  // Checks save status - overcome autosave, etc.
  $is_autosave = wp_is_post_autosave( $post_id );
  $is_revision = wp_is_post_revision( $post_id );
  $is_valid_nonce = ( isset( $_POST[ 'member_page_nonce' ] ) &amp;&amp; wp_verify_nonce( $_POST[ 'member_page_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';
  
  
      // Exits script depending on save status
      if ( $is_autosave || $is_revision || !$is_valid_nonce ) {
          return;
      }
  
  // Checks for input and saves - save checked as yes and unchecked at no
  if( isset( $_POST[ 'featured-checkbox' ] ) ) {
      update_post_meta( $post_id, 'featured-checkbox', 'yes' );
  } else {
      update_post_meta( $post_id, 'featured-checkbox', 'no' );
  }
  
  }
  add_action( 'save_post', 'member_page_meta_save' );
  </code></pre>
  
  <p>What I need is to make it so that I can use this to show/hide content in Wordpress using Php, but I don't exactly know how to target it in a php if statement.</p>
  
  <p>Do I use the name (featured-checkbox), id (#featured-checkbox), fuction name ($member_page_featured_meta), etc.</p>
  
  <p>And then to make that a specific bit of HTML, how would I want to go about doing that?</p>
  
  <p>HTML/PHP that I am trying to hide when the box is checked.</p>
  
  <pre><code>&lt;header class="entry-header"&gt;
      &lt;div style="float:right;"&gt;
          &lt;div id="membership" "class='false' if not member"&gt;&lt;/div&gt;
          &lt;div id="phone-answering" "class='false' if not phone client"&gt;&lt;/div&gt;
          &lt;div id="location-icon" "class='false' if only one location"&gt;&lt;/div&gt;
      &lt;/div&gt;      
      &lt;?php the_title( '&lt;h1 class="entry-title" style="clear:none; font-size: 3em; text-decoration: underline;"&gt;', '&lt;/h1&gt;' ); ?&gt;
  &lt;/header&gt;&lt;!-- .entry-header --&gt;
  &lt;div class="entry-content"&gt;
      &lt;div id="tabs"&gt;
          &lt;ul class="tabs"&gt;
              &lt;li&gt;&lt;a href="#key-intake" role="tab" data-toggle="tab"&gt;Key Intake&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#business-facts" role="tab" data-toggle="tab"&gt;Business Facts&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#common-answers" role="tab" data-toggle="tab"&gt;Common Answers&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#understanding" role="tab" data-toggle="tab"&gt;Understanding&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#current" role="tab" data-toggle="tab"&gt;Current&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#location" role="tab" data-toggle="tab"&gt;Locations&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#notify" role="tab" data-toggle="tab"&gt;Notify&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;div id="key-intake" class=""&gt;
              &lt;h1  class="tabtitle"&gt;Key Intake&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $key_intake_meta_value = get_post_meta( get_the_ID(), 'Key Intake', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $key_intake_meta_value ) ) {
                      echo $key_intake_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="business-facts"&gt;
          &lt;h1 class="tabtitle"&gt;Business Facts&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $business_facts_meta_value = get_post_meta( get_the_ID(), 'Business Facts', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $business_facts_meta_value ) ) {
                      echo $business_facts_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="common-answers"&gt;
              &lt;h1 class="tabtitle"&gt;Common Answers&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $common_answers_meta_value = get_post_meta( get_the_ID(), 'Common Answers', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $common_answers_meta_value ) ) {
                      echo $common_answers_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="understanding"&gt;
              &lt;h1 class="tabtitle"&gt;Understanding&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $understanding_meta_value = get_post_meta( get_the_ID(), 'Understanding', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $understanding_meta_value ) ) {
                      echo $understanding_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="current"&gt;
              &lt;h1 class="tabtitle"&gt;Current&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $current_meta_value = get_post_meta( get_the_ID(), 'Current', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $current_meta_value ) ) {
                      echo $current_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="location"&gt;
              &lt;h1 class="tabtitle"&gt;Locations&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $locations_meta_value = get_post_meta( get_the_ID(), 'Locations', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $locations_meta_value ) ) {
                      echo $locations_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
          &lt;div id="notify"&gt;
              &lt;h1 class="tabtitle"&gt;Notify&lt;/h1&gt;
              &lt;?php 
                  // Retrieves the stored value from the database
                  $notify_meta_value = get_post_meta( get_the_ID(), 'Notify', true );
  
                  // Checks and displays the retrieved value
                  if( !empty( $notify_meta_value ) ) {
                      echo $notify_meta_value;
                  } else {
                      echo 'Value Not Fount or Empty';
                  }
              ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php
          the_content();
  
          wp_link_pages( array(
              'before' =&gt; '&lt;div class="page-links"&gt;' . esc_html__( 'Pages:', 'odextranet' ),
              'after'  =&gt; '&lt;/div&gt;',
          ) );
      ?&gt;
  &lt;/div&gt;&lt;!-- .entry-content --&gt;
  </code></pre>