Is there any way to get this
<?php
$pc = new WP_Query ('category_name=cat1&posts_per_page=5');
?>
but each time display a RANDOM different batch of 5 ones?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityPlease try this:
$args = array(
'category_name' => 'cat1',
'posts_per_page' => 5,
'orderby' => 'rand',
);
$pc = new WP_Query( $args );
where 'rand'
should give you a random order of your posts.
For more info check out the Codex on WP_Query
order parameters here.
rand
order is very expensive on the database