Customized 404 Error Page For Blogger

Customized 404 Error Page For Blogger

The HTTP 404, 404 Not Found and 404 error message page is a Hypertext Transfer Protocol (HTTP) standard response code. This error often occurs when you follow a broken link or if you type in a website address that doesn’t exist. A 404 page error appears when a website is active, but the specific page within it doesn’t exist. A different error appears if the whole website you’re visiting is unavailable. Blogger has its own 404 page but it looks slightly outdated. You can easily add custom 404 page to blogger using blogger error conditional tag.

Customized 404 Error Page For Blogger

How to setup custom 404 page for blogger ?




Step1: Go to Blogger>Theme>Edit Html .

Step2: Search for <body expr:class='&quot;loading&quot; + data:blog.mobileClass'> or <body> and paste below codes just after it.

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<div class='404page'>
<div style='line-height: 30px;'>
<div style="font-size:20px;">
<div style="display:block;margin:0 20px;">
  <br/><br/><strong><span style='color: red; font-size: 30px;'>
Oops!</span> <span style='color: black;'>
Looks like you either clicked a broken link or search a Page that no more exists. Kindly do one of the followings:</span></strong><br/>
<span style='color: black;'><b>1.</b> <a href='javascript:history.go(-1)'>&#171; Go Back</a></span><br/>
<span style='color: black;'><b>2.</b> Report the Problem to us by</span> <a href='YOUR CONTACT PAGE URL'>Clicking Here</a><span style='color: black;'/><br/>
<span style='color: black;'><b>3.</b> Go To </span><a href='/'>Homepage</a><br/>
  <br/></div></div>
<div class='separator' style='clear: both; text-align: center;'>
<a href='' imageanchor='1' style='margin:auto;'><img border='0' height='' src='https://4.bp.blogspot.com/-mWrc4nXqHI4/WRLU1ULZYHI/AAAAAAAABs0/fm0tid0CmIYYyxgtS9LdpTVVonYIgr4QwCLcB/s1600/eyes-304338_960_720.png' width='60%'/></a></div>
<div class='separator' style='clear: both; text-align: center;'>
<br/></div><div class='separator' style='clear: both; text-align: center;'>
<br/></div> </div></div></b:if>

Note: Change red text with your contact page.

Step3: Now, Search for ]]></b:skin> and paste below conditional CSS codes just after it.

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
<style>
.content{display:none;}
</style>
    </b:if>

Step4: Save theme , That's it.

No comments:

Post a Comment