How to get all first images of posts in same category?

Question

I want my category first post to have a photo
and the other of the category posts don’t have photos

What am I doing wrong? EDIT: Or is this even possible?

 <?php query_posts('cat=' . get_option('theme_cat_name"') . '&showposts=' . get_option('theme_cat_count')); ?>
            <?php $count = 0; ?>
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <?php $count++; ?>
            <?php if ($count == 1) : ?>
                <?php the_post_thumbnail( 'carousel-thumb', array( 'class' => 'img-fluid hvr-grow ' ) ); ?>
                <h2><?php the_title(); ?></h2>
                <?php else : ?>
                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                <?php endif; ?>
            <?php endwhile; ?>
            <?php endif; ?>
0
, Ezatullah Tabish 5 days 0 Answers 34 views 0

Leave an answer