If page has posts in certain category – wordpress

Solution:1

You can check if current post is in category by using

if( has_category('Deals') ) {
// do stuff here
}

If $post global variable is set has_category('Deals') will be ok. Otherwise you will need to pass post ID as second parameter. https://developer.wordpress.org/reference/functions/has_category/

P.S. If you are calling it in a loop it looks like you are trying to echo the same inline css multiple times. This will hide all .entry-thumbs regardless of the category. So it may be better to add a class to your deal posts and then use something like .deal .entry-thumb{ display: none; } in your style.css.

Solution:2

Use following code

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="box">
            <h2 class="archive-title" style="text-align:center">Artikel</h2>
            <hr />
            <ul class="postlist"> 
                <?php if (in_category('wissen')) : ?>

                    <li>

                        <?php if (has_post_thumbnail()): ?>
                            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(150, 150)); ?>
                            <?php else: ?>
                                <div class="postlistfilling"></div>
                            <?php endif; ?>      

                            <a class="postlisttitle" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

                            <div class="pthumb">  
                                <?php the_excerpt(); ?>
                            </div>

                    </li>

                </ul>
            </div>  
        <?php endif; endwhile; endif; ?>