Files
LiveCartaWP/htdocs/wp-content/themes/lawcarta/page_resource_item.php
Denis Bunevich f6312ff90c build test
2025-12-08 09:07:57 +01:00

47 lines
1.1 KiB
PHP

<?php
/**
* Template Name: Resource Item
*/
get_header();
if (have_posts()):
while (have_posts()):
the_post();
?>
<div class="content">
<?= the_content(); ?>
<script>
document.addEventListener("DOMContentLoaded", (event) => {
const btn = document.querySelector("#submit");
btn.addEventListener("click", ( event ) => {
btn.classList.add("btn-loading");
},false);
document.addEventListener( 'wpcf7invalid', ( event ) => {
btn.classList.remove("btn-loading");
},false);
document.addEventListener( 'wpcf7mailfailed', ( event ) => {
btn.classList.remove("btn-loading");
},false);
document.addEventListener( 'wpcf7mailsent', ( event ) => {
if (typeof pdfUrl === "undefined") {
console.warn("please add pdfUrl");
return;
}
btn.classList.remove("btn-loading");
window.open(pdfUrl, "_blank");
}, false );
});
</script>
</div>
<?php
endwhile;
endif;
get_footer();