hide block of code if featured image exists
-
i seem to be getting my quotes and double quotes hosed up maybe? I’m trying to either show or hide this entire block of code IF a featured image exists . . . lil’ help?
<div class="articlePhoto"> <div class="articleImage"><?php echo get_the_post_thumbnail( get_the_ID(), 'medium', array ( 'class' => 'styled-image' ) ); ?></div> <div class="relatedContent module"> <div class="moduleHeight"> <h3>You Might Also Consider</h3> <div class="moduleContent"> <ul class="icons"> <?php $post_categories = wp_get_post_categories( $post->ID ); ?> <?php $query = array ( 'post_type' => 'articles', 'articletype' => 'news', 'category__in' => $post_categories, 'posts_per_page' => 5 ); ?> <?php $queryObject = new WP_Query($query); ?> <?php if ($queryObject->have_posts()) : while ($queryObject->have_posts()) : $queryObject->the_post(); ?> <li class="icon-file"><a href="articles/<?php echo basename(get_permalink()); ?>/"><?php if (strlen($post->post_title) > 40) { echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else { the_title();} ?> </a></li> <?php endwhile; else: ?> <li>No research articles found.</li> <?php endif; ?> <?php wp_reset_query(); ?> </ul> <p><a href="/articles/news/"><i class="icon-circle-arrow-right"></i> See all items for sleep.</a></p> </div> </div> </div> <div class="clear"></div> </div>
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘hide block of code if featured image exists’ is closed to new replies.