Displaying a random testimonial on your Webflow page upon refresh involves using JavaScript to manipulate the testimonials dynamically without relying solely on the Random/Shuffle Order settings. Here’s a step-by-step guide to help you achieve this:
```javascript
<script>
// Wait until page has loaded
document.addEventListener('DOMContentLoaded', function() {
// Gather all testimonials
var testimonials = document.querySelectorAll('.testimonial-class');
// Hide all testimonials initially
testimonials.forEach(function(testimonial) {
testimonial.style.display = 'none';
});
// Choose a random testimonial to display
var randomIndex = Math.floor(Math.random() * testimonials.length);
testimonials[randomIndex].style.display = 'block';
});
</script>
```
.testimonial-class with the actual class or ID name of your testimonials if different.
To display one random testimonial on each page refresh, organize your testimonials with clear identifiers, use JavaScript to control their visibility, and ensure everything is properly linked and functioning by testing the published site. This method gives you control over displaying testimonials without solely relying on Webflow's built-in order settings.