I´m using elementor, and I tried this with chatgpt but we dont get it, out of this position.
We tried it with Elementor Inividual Code, I tried it with, Snippets and I tried that with WP Snippets, quite frankly I don´t even have an Idea what an Javascript code is or would even know how to write a code like this for example, but no code gpt wrote worked
so in the end I switched of your Plugin. Spending money on a plug in is something I do cause I dont want do work with coding as I don´t have a clue about it.
"<script>
(function () {
function findCross() {
const guessByClass = document.querySelector(
'.wpf-cross-posting, .wpforo-cross-posting, .wpforo-crosspost, .crossposting'
);
const anchor = Array.from(document.links).find(a =>
(/more discussion|mehr diskussion|wpforo|forum/i.test(a.textContent) ||
/\/community\/|\/forum\//i.test(a.href))
);
const cross = guessByClass || (anchor ? (anchor.closest('div, section, aside, footer, span') || anchor) : null);
const target =
document.querySelector('.elementor-widget-theme-post-content .elementor-widget-container') ||
document.querySelector('article .entry-content') ||
document.querySelector('.entry-content') ||
document.querySelector('article');
if (cross && target && !target.contains(cross)) {
cross.style.visibility = 'hidden';
target.appendChild(cross);
cross.classList.add('crosspost--moved');
cross.style.visibility = 'visible';
return true;
}
return false;
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', findCross, { once: true });
} else {
findCross();
}
const obs = new MutationObserver(() => { if (findCross()) obs.disconnect(); });
obs.observe(document.documentElement, { childList: true, subtree: true });
})();
</script>
"