mercredi 3 juin 2015

How to Only Show Certain Posts in Widget?

I am working on a site and I'm having trouble customizing one of the widgets that came with the template. It's a real estate site, and on the main page there is a widget that grabs post's thumbnails and select info. I've broken the widget in two, so one side shows the posts as it normally does and the other side is to show posts that have the field "hot deal" marked as true. See here http://ift.tt/1H0HYo7

How can I make it so only "hot deals" shows up on the Specials side? Right now, it's showing in both. I'm not too versed in php, but I usually manage to get through it.

I think this is the php in question

<?php 
        if(has_post_thumbnail()) {
          if ($instance["thumb"]) : ?>
          <figure class="featured-thumbnail thumbnail">
         <?php if ( $instance['thumb_as_link'] ) : ?>
              <a href="<?php the_permalink() ?>"><?php if ($hotdeal) { echo '<div class="hot-deal"></div>'; } ?>
            <?php endif; ?>
         <?php if($instance['thumb_w']!=="" || $instance['thumb_h']!==""){
              $thumb_w = $instance['thumb_w'];
              $thumb_h = $instance['thumb_h']; ?>
              <img src="<?php echo $image; ?>" width="<?php echo $thumb_w ?>" height="<?php echo $thumb_h ?>" alt="<?php the_title(); ?>" />
            <?php }else{?>
              <?php the_post_thumbnail(); ?>
            <?php }?>
            <?php if ( $instance['thumb_as_link'] ) : ?>
              </a>
            <?php endif; ?>
            <?php if ( is_front_page() ) { ?> <?php if ($area) { ?><div class="area"><?php echo $area; ?></div><?php } ?><?php } ?>
          </figure>
        <?php endif;
      }     ?>

Is there an if statement I could write to achieve the results I'm looking for?

Aucun commentaire:

Enregistrer un commentaire