Forum Replies Created

Viewing 1 replies (of 1 total)
  • 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: https://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)