News and Announcements

Translate »
document.addEventListener("DOMContentLoaded", function() { const links = document.querySelectorAll(".announcement-link"); const contentContainer = document.getElementById("announcement-content");links.forEach(function(link) { link.addEventListener("click", function(event) { event.preventDefault(); const postId = this.getAttribute("data-post-id");fetch("/wp-json/wp/v2/posts/" + postId) .then(function(response) { return response.json(); }) .then(function(post) { contentContainer.innerHTML = post.content.rendered; }) .catch(function(error) { console.error("Error fetching post:", error); }); }); }); });