title: Expression Engine - How do I display content based on custom field content?
body: <p>I am working on an Expression Engine site and I am trying to get the content from two different channels to display in the same section based on a condition.</p>
  
  <p>The home page has a slider that links to a variety of content. I created a channel for this with four fields. The article section has independent content but on occasion this needs to be highlighted in the slider on the home page. </p>
  
  <p>To meet this need I added a "display in slider" field with a NO/YES option followed by fields that hold content similar to the slider content but with unique names.</p>
  
  <p>Here is the challenge: how do I write the conditional to display only those entries where the "display in slider" field is set to YES. The following code has one flaw: it still displays part of the content from the entries where the "display in slider" is set to NO because it meets the conditions of the if:else options.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;div id="slider"&gt;
  {exp:channel:entries channel="slider|garden_advice" disable="categories|category_fields|member_data|pagination"}
  {if display_in_slider == "YES"}
  &lt;div class="slider-content"&gt;    
  &lt;div class="slider-image"&gt;
  &lt;img src="{slider_photo_ga}" alt="{title}" &gt;
  &lt;/div&gt;
  &lt;h3&gt;{title}&lt;/h3&gt;
  &lt;span class="sub-title"&gt;{sub_title_ga}&lt;/span&gt;
  &lt;p&gt;{slider_text_ga}&lt;/p&gt;
  &lt;div class="link-box"&gt;
  &lt;a href="{site_url}garden-advice/article/{url_title}"&gt;{link_text_ga}&lt;/a&gt;
  &lt;/div&gt;
  &lt;/div&gt;&lt;!-- end .slider-content --&gt;
  {if:else}
  &lt;div class="slider-content"&gt;    
  &lt;div class="slider-image"&gt;
  &lt;img src="{slider_photo}" alt="{title}" &gt;
  &lt;/div&gt;
  &lt;h3&gt;{title}&lt;/h3&gt;
  &lt;span class="sub-title"&gt;{sub_title}&lt;/span&gt;
  &lt;p&gt;{slider_text}&lt;/p&gt;
  
  {if entry_id != 5014}
  &lt;div class="link-box"&gt;
  {link_text}
  &lt;/div&gt;
  {if:else}
  {link_text}
  {/if}
  &lt;/div&gt;&lt;!-- end .slider-content --&gt;
  {/if}
  {/exp:channel:entries}
  &lt;/div&gt;&lt;!-- end .slider --&gt; 
  </code></pre>
  
  <p>My question is: how can I modify the conditional so that only the garden_advice channel is considered in the first if statement and only the slider channel is considered in the second one?</p>
  
  <p>Thanks!</p>