I resolved this myself using ChatGPT
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<style>
.slideshow-container {
position: relative;
max-width: 100%;
}
.mySlides {
display: none;
}
.fade {
animation-name: fade;
animation-duration: 3s;
}
@keyframes fade {
from { opacity: .4 }
to { opacity: 1 }
}
</style>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = "block";
setTimeout(showSlides, 5000); // Change image every 5 seconds
}
});
</script>
</head>
<body <?php body_class(); ?>>
<!-- Slideshow container -->
<div class="slideshow-container">
<div class="mySlides fade">
<img src="image1.jpg" style="width:100%">
</div>
<div class="mySlides fade">
<img src="image2.jpg" style="width:100%">
</div>
<div class="mySlides fade">
<img src="image3.jpg" style="width:100%">
</div>
</div>
<!-- Rest of your header content -->