I figured it out.
First put this code into your Child theme’s function.php file:
session_start();
add_filter( 'posts_orderby', 'randomise_with_pagination' );
function randomise_with_pagination( $orderby ) {
if( is_category( 'Alabama' ) ) {
// Reset seed on load of initial archive page
if( ! get_query_var( 'paged' ) || get_query_var( 'paged' ) == 0 || get_query_var( 'paged' ) == 1 ) {
if( isset( $_SESSION['seed'] ) ) {
unset( $_SESSION['seed'] );
}
}
// Get seed from session variable if it exists
$seed = false;
if( isset( $_SESSION['seed'] ) ) {
$seed = $_SESSION['seed'];
}
// Set new seed if none exists
if ( ! $seed ) {
$seed = rand();
$_SESSION['seed'] = $seed;
}
// Update ORDER BY clause to use seed
$orderby = 'RAND(' . $seed . ')';
}
return $orderby;
}
Now next –
You need to create a php file for each category using these instructions: https://docs.presscustomizr.com/article/172-using-the-wordpress-template-hierarchy-with-the-customizr-theme.
Then place your php randomizing code within the php file – which is:
<?php /* Start the Loop */ ?>
<?php
if (is_category(‘your-category-slug-name’)) {
query_posts($query_string . ‘&orderby=rand’);
}
else {
query_posts($query_string . ‘&orderby=title&order=ASC’);
}
?>
<?php while ( have_posts() ) : the_post(); ?>
Now Customizr’s instructions are to add this file to the Child Theme. I could not make this work for my site. So I tried going to the root level of the template where index.php is and I added it there.
Once I did all that – I refreshed the category page and wa la – my category posts were now displaying in random order across all pages without duplicates.