I have a website I’m currently developing where the user can switch the language of the page. If they switch the language i have to change a button that controls a download file. I have two separate file ACF’s. is there a way to use connection fields to check the status of the page, if it’s English or French, to then conditionally display the correct button download accordingly. The URL changes from /example/ to /fr/example/. Is there a way i can check for the /fr/ to then switch it using wpbb-if or elseif?
I ended up just using JavaScript to check the url to then display: none classes accordingly! Thanks for the reply!
window.addEventListener("DOMContentLoaded", () => {
if (window.location.href.indexOf('fr') > 0) {
document.querySelectorAll(".en_buttons").forEach((button) => button.style.display = "none")
}
else if (window.location.href.indexOf('en') > 0) {
document.querySelectorAll(".fr_buttons").forEach((button) => button.style.display = "none")
}
});