Plugin Author
Aert
(@aahulsebos)
Hi @alecar,
You can disable Complianz on that specific post you’re embedding if possible, under post edit, right-hand sidebar.
This will disable Complianz on that post, a hybrid version where you need to remove it in the iFrame itself is only possible with some custom javascript.
regards Aert
Plugin Author
Aert
(@aahulsebos)
Or try:
// Check if the current window has a parent window
if (window.parent !== window) {
// If the current window has a parent window, hide the cookie banner
var cookieBanner = document.querySelector('.cmplz-cookiebanner');
if (cookieBanner) {
cookieBanner.style.display = 'none';
}
}
Thread Starter
alecar
(@alecar)
Hello Aert,
For some reason when the embed post loads, it does not load my theme’s custom css and js, so the solution I found was inserting a style tag inside of embed-content.php wordpress core file with this code on my functions.php:
function custom_embed_styles() {
// Your custom styles here
$custom_styles = "
.post-template-default div#cmplz-cookiebanner-container,
.post-template-default #cmplz-manage-consent {
display: none;
}
.post-template-default.tdb-template #cmplz-manage-consent,
.post-template-default.tdb-template #cmplz-cookiebanner-container {
display: block !important;
}
.td-wp-booster-error {
display: none !important;
}
";
echo '<style type="text/css">' . $custom_styles . '</style>';
}
add_action('embed_head', 'custom_embed_styles');
I do not know if the best way, but it worked for me.
Thank you for your quick reply!
Kind regards.
-
This reply was modified 2 years, 9 months ago by
alecar.