title: Advanced Custom Fields else if
body: <p>I am trying to display store hours for 3 different locations with Advanced Custom Fields in WordPress. When I take out the entire middle section with the else if statement, it works correctly for the other 2 locations. As soon as I add in the section with the else if statement, the store hours go blank for all pages. Any help would be greatly appreciated. Here is what I have so far:</p>
  
  <p>First section</p>
  
  <pre><code>&lt;?php if (is_single( 3823 ) ){ ?&gt;
  
  
  &lt;section class="hours"&gt;
    &lt;h3&gt;Outlet Hours:&lt;/h3&gt;
  
      &lt;section class="hours-section"&gt;
        &lt;?php if(get_field('store_hours')): ?&gt;
          &lt;?php while(has_sub_field('store_hours')): ?&gt;
            &lt;p class="days"&gt;&lt;b&gt;&lt;?php the_sub_field('store_hours_day'); ?&gt;:&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed')  == "open") { ?&gt;
              &lt;p class="hours-hours"&gt;
                &lt;?php the_sub_field('store_hours_morning_time'); ?&gt;&amp;nbsp;am
                -
                &lt;?php the_sub_field('store_hours_evening_time'); ?&gt;&amp;nbsp;pm
              &lt;/p&gt;
            &lt;?php } ?&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed')  == "closed") { ?&gt;
              &lt;b&gt;Closed&lt;/b&gt;
            &lt;?php } ?&gt;
            &lt;br/&gt;
          &lt;?php endwhile; ?&gt;
        &lt;?php endif; ?&gt;
      &lt;/section&gt;
  
  &lt;/section&gt;&lt;!-- .sidebar --&gt;
  </code></pre>
  
  <p>Second Section</p>
  
  <pre><code>&lt;?php else if (is_single( 2284) ){ ?&gt;
  
  
  &lt;section class="hours"&gt;
    &lt;h3&gt;Builder Hours:&lt;/h3&gt;
  
      &lt;section class="hours-section"&gt;
        &lt;?php if(get_field('store_hours')): ?&gt;
          &lt;?php while(has_sub_field('store_hours')): ?&gt;
            &lt;p class="days"&gt;&lt;b&gt;&lt;?php the_sub_field('store_hours_day'); ?&gt;:&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed')  == "open") { ?&gt;
              &lt;p class="hours-hours"&gt;
                &lt;?php the_sub_field('store_hours_morning_time'); ?&gt;&amp;nbsp;am
                -
                &lt;?php the_sub_field('store_hours_evening_time'); ?&gt;&amp;nbsp;pm
              &lt;/p&gt;
            &lt;?php } ?&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed')  == "closed") { ?&gt;
              &lt;b&gt;Closed&lt;/b&gt;
            &lt;?php } ?&gt;
            &lt;br/&gt;
          &lt;?php endwhile; ?&gt;
        &lt;?php endif; ?&gt;
      &lt;/section&gt;
  
  &lt;/section&gt;&lt;!-- .sidebar --&gt;
  </code></pre>
  
  <p>Third Section</p>
  
  <pre><code>  &lt;?php } 
    else { ?&gt;
  
  &lt;?php $other_page = 47; ?&gt; 
  
  &lt;section class="hours"&gt;
    &lt;h3&gt;Retail Hours:&lt;/h3&gt;
  
      &lt;section class="hours-section"&gt;
        &lt;?php if(get_field('store_hours', $other_page)): ?&gt;
          &lt;?php while(has_sub_field('store_hours', $other_page)): ?&gt;
            &lt;p class="days"&gt;&lt;b&gt;&lt;?php the_sub_field('store_hours_day', $other_page); ?&gt;:&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed', $other_page)  == "open") { ?&gt;
              &lt;p class="hours-hours"&gt;
                &lt;?php the_sub_field('store_hours_morning_time', $other_page); ?&gt;&amp;nbsp;am
                -
                &lt;?php the_sub_field('store_hours_evening_time', $other_page); ?&gt;&amp;nbsp;pm
              &lt;/p&gt;
            &lt;?php } ?&gt;
            &lt;?php if (get_sub_field( 'store_hours_closed', $other_page)  == "closed") { ?&gt;
              Closed
            &lt;?php } ?&gt;
            &lt;br/&gt;
          &lt;?php endwhile; ?&gt;
        &lt;?php endif; ?&gt;
      &lt;/section&gt;
  
  &lt;/section&gt;&lt;!-- .sidebar --&gt;
  </code></pre>