I am calling a template part if a term is not null, if it is, it does not call the template part. It does function for everything after the loop, but the <h3>Shows up no matter if the term is null or not. How could I do this without including the <h3> in the loop.

The Call for template
PHP Code:
$term term_exists('the cat''category');
        if (
$term !== null) {
The Template

<h3>Head Line</h3>
    <ul id="clearfix">
        $theloops = new WP_Query(array(
        'category__in' => array(1),
		'showposts' => '12',
		'post_type' => array(
        <?php while ($theloops->have_posts()) : $theloops->the_post(); ?>
           <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail($id, 'thumbnail'); ?></a>
        <?php endwhile; wp_reset_postdata(); ?>