PHP nested If statement syntax
you can’t run code inside quote since php treats it as string, try this: <?php $newsposts = new WP_Query(‘cat=restaurant’); if ( is_front_page()) { echo ‘<h3 class=”member-review”>Latest Restaurants</h3> <div id=”extra”>’; if ($newsposts->have_posts()) : while ($newsposts->have_posts()) : $newsposts->the_post(); echo ‘<div class=”reslogo”><img src=”‘.catch_that_image().'”/></div>’; endwhile, endif; echo ‘</div>’; } ?>