Title: mlopez84's Replies | WordPress.org

---

# mlopez84

  [  ](https://wordpress.org/support/users/mlopez84/)

 *   [Profile](https://wordpress.org/support/users/mlopez84/)
 *   [Topics Started](https://wordpress.org/support/users/mlopez84/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mlopez84/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mlopez84/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mlopez84/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mlopez84/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mlopez84/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Custom Field Checkbox with WordPress [Flutter]](https://wordpress.org/support/topic/custom-field-checkbox-with-wordpress-flutter/)
 *  [mlopez84](https://wordpress.org/support/users/mlopez84/)
 * (@mlopez84)
 * [17 years ago](https://wordpress.org/support/topic/custom-field-checkbox-with-wordpress-flutter/#post-819398)
 * Hello
    I was glad I found this post but I ran into a bit of trouble when trying
   to have multiple conditional items on a page.
 * So far I have my checkboxes working in the admin to hide and show the content
   when needed. But I want to have a second or more optional field display if chosen
   in the admin. It seems I’m doing something wrong with the query_posts() tag. 
   If I use it only once I get both boxes showing up correctly conditionally.
 * Here’s the code I’m using if anyone can help I would gladly appreciated :-]
    
   URL: [http://moisesl.com/blog/about](http://moisesl.com/blog/about)
 *     ```
       <div class="lowerBox">
   
       <?php if (get_post_meta($post->ID, 'news_awards', true) and query_posts('category_name=news-awards&amp;showposts=4'))  { ?>
       	<!-- Begin Awards -->
       	<div id="news_and_awards">
       	<ul>
           <?php while (have_posts()) : the_post(); ?>
               <li><?php the_title(); ?> <a href="<?php the_permalink(); ?>"><b>more>></b></a></li>
           <?php endwhile;?>
           <li><a href="#">TEst News and Awards</a></li>
           </ul>
           </div>
           <!-- End Awards -->
   
       <?php } else { ?>
       News and awards displaying nothing because its false
       <?php } ?>
   
       <?php if (get_post_meta($post->ID, 'offices', true) and query_posts('category_name=office-locations&amp;showposts=5')) { ?>
           <!-- Begin Offices -->
           <div id="office_locations">
           <ul>
           <?php while (have_posts()) : the_post(); ?>
               <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
           <?php endwhile;?>
           </ul>
               <ul>
                 <li><a href="#">TEst Office</a></li>
                 <li><a href="#"></a></li>
               </ul>
           </div>
           <!-- End Offices -->
   
       <?php } else { ?>
       <?php } ?>
       ```
   

Viewing 1 replies (of 1 total)