Is it possible to change the layout of the query posts depending on how many there are?
So simple query page listing posts...
Up to 4 posts show them in a list.
If there are 4 posts and over show them as float blocks for example.
for a standard query, you can check the amount of posts with:
all posts for the query:
$wp_query->found_posts
and the posts on the page:
$wp_query->post_count
use that with a conditional statement to switch to the different layouts.
example:
<?php if ( have_posts() ) : //start of the loop//
if ( $wp_query->found_posts <= 4 ) { ?>
list output of posts
//this will need to include the 'while(have_posts())' including the 'endwhile' of the loop
<?php } else { ?>
float block output
//this will need to include the 'while(have_posts())' including the 'endwhile' of the loop
<?php }
endif; ?>
echo $wp_query->found_posts;
before the code