File: /var/www/stg-everycred.com/wp-content/themes/everycred/single-case_studies.php
<?php get_header(); ?>
<?php if ( have_rows('case_study') ) : ?>
<?php while ( have_rows('case_study') ) : the_row(); ?>
<?php
$layout = get_row_layout();
$file = locate_template('template-parts/case-study/' . $layout . '.php');
if ( $file ) {
include $file;
}
?>
<?php endwhile; ?>
<?php endif; ?>
<?php get_template_part( 'template-parts/case-study/footer_cta' ); ?>
<!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Scroll reveal
const ro = new IntersectionObserver((es) => {
es.forEach(e => {
if (e.isIntersecting) {
e.target.classList.add('visible');
ro.unobserve(e.target);
}
});
}, {
threshold: 0.08,
rootMargin: '0px 0px -40px 0px'
});
document.querySelectorAll('.reveal').forEach(el => ro.observe(el));
// Smooth scroll anchors
document.querySelectorAll('a[href^="#"]').forEach(a => {
a.addEventListener('click', e => {
const t = document.querySelector(a.getAttribute('href'));
if (t) {
e.preventDefault();
window.scrollTo({
top: t.offsetTop - 90,
behavior: 'smooth'
});
}
});
});
</script>
<?php get_footer(); ?>