How to hide blogger blog header when calling inside a static webpage using iframe

432 Views Asked by At

Our organization is having a blogger blog and now we are planning for website and in which we are planning to call the blog page using iframe, but when we does the entire blog page comes in and we want to remove or hide the blog header when called inside the website, Is there any way to do this

2

There are 2 best solutions below

0
chrki On

Blogger allows you to add custom CSS and Javascript to your template.

I tested this based on the "Simple" theme with no further modifications. Go to Theme - Edit HTML in your blog's settings and add this code (based on this snippet) somewhere below the header widget:

<script type="text/javascript">
if (window.self !== window.top){
    document.getElementById("header").style.display = "None"
}
</script>

header is the id of that widget as defined in the HTML template:

<b:section class='header' id='header' ...
0
Kiran M R On

Thanks for the answer guys, I resolved it by using the following in the blog code

<script type="text/javascript">
   var isInIFrame = (window.location != window.parent.location);
   if(isInIFrame==true){

       document.getElementById('tohide').style.display = "none";
       }   
</script>