I was trying the solution found in: Hide header if in iframe and when the iframe is laoded it truly works, but if I click in any link on my website the header appears, I don't want the header to be shown in ANY pages if it is in a iframe.
for now my code is
function no_header_iframe(){ ?>
<script type="text/javascript">
function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
if(inIframe()){
$('nav').addClass('hidden').hide();
}
</script>
<?php }
add_action('wp_footer', 'no_header_iframe');
since my site is in wordpress.
How can I hide the header in all the pages? (if the site is loaded in an iframe, of course)