In a custom post archive; Is it possible to reduce the the number of posts shown, depending on the contents of the showing posts?
I have a custom post type for products. In the product archive there are 20 products showing on each page, 4 rows, 5 cols. In some cases where the product image is super wide I'd like that product to be shown with double width.
When showing a super wide product, I'd like to reduce the number of posts to 19 (18 if there are two super wide products). Keeping the bottom line straight.
This is the loop for my custom post archive. I got your point with numcols. And as you say, I should probably modify the query, making sure that page 2 and 3 (and on) shows the right posts.
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>" class="produkt_item normal various" data-fancybox-type="iframe">
<?php if ( has_post_thumbnail() ) { ?>
<div class="utvaldbild">
<?php the_post_thumbnail('produktbild'); ?>
</div>
<?php } ?>
<h2><?php the_title();?></h2>
<p><?php the_field('produktnotis'); ?></p>
<?php if (get_field('nedladdning')) { ?><div class="nedladdning"></div><?php } ?>
</a>
<?php endwhile; ?>