How to Hide Blogger Sidebar to Display AdSense For Search Results
Blogger Tips

How to Hide Blogger Sidebar to Display AdSense For Search Results


When visitors are searching for content on your blog, you have three options to display the search results: opening the results in the same window, in a new window or within your own site using an iframe.

The best option would be, however, to display the search results within your own site/blog, mainly because you are not sending people off your blog when they are taken to a new page of search results which could be confusing for many because it doesn't look anything like your site or Google. Therefore, displaying the search results within your site, could make it look much more professional and may also increase the page views and the revenue from the ads on the search page.

A problem that many bloggers are facing is that the page which displays the AdSense for search results must be at least of 800 px wide, so the posting area must be of minimum 800px and there's nothing like this in most of the blogs.
So, what we will do in this tutorial is to set up the search results to be displayed in a static page (none of other posts or pages will be affected) in which we'll remove the sidebar so that we'll have enough space to make the post/page section of 800px wide. Moreover, we will create a static page designed only for the search results, then create a new AdSense for search in our AdSense account and finally add a small snippet of code top in your Blogger template to hide the sidebar in that specific page.

Search results span the width of the page with the sidebar hidden:


Display AdSense For Search Results Within Blogger Page

Step 1. Create a new static page on your blog, you can give it the title 'Search Results' but leave the content section empty and then Publish the page.

Step 2. When you publish the page you have the option to add the page to a menu, choose the third option 'No Gadget Link To Pages Manually' click 'Save and Publish'. In case this screen doesn't show, right click on View Page and select Copy Link Address. We will need this URL of the page later when we will create the AdSense for search.

Step 3. Go To Your AdSense account, then go to My ads tab, select the Search option and Create a New custom search engine. Follow the steps until you come to the Search results option.

Step 4. Select the 3rd method "on my website using an iframe", then Enter the URL of the page you created into the URL field and continue.


Step 5. Follow the rest of the set up process and at the end you will be given two pieces of code. The first piece of code is for the actual search bar which you can paste into a Html/JavaScript gadget on your sidebar or wherever you want it. The second piece of code you need to copy and paste it into a new HTML/JavaScript gadget, click on Save, then drag it above the Blog Posts area


Now that you have your page set up with the search results code and your search bar code in your sidebar, it is time to add a snippet of code to your template to remove the sidebar.

Adding The Code In Blogger To Change the Results Page Layout

Step 1. From Your Blogger Dashboard, go to Template and click on the Edit HTML button


Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the Blogger' search box

Step 3. Find (CTRL + F) the following piece of code
]]></b:skin>
Step 4. Just below it, paste this code:
<b:if cond='data:blog.url == &quot;PAGE-URL-HERE&quot;'>
<style>
.main-inner .columns {
padding-left: 0px !important;
padding-right: 0px !important;
}
.main-inner .fauxcolumn-center-outer {
left: 0px !important;
right: 0px !important;
}
.main-inner .fauxcolumn-left-outer, .main-inner .fauxcolumn-right-outer, .main-inner .column-left-outer, .main-inner .column-right-outer {
display: none !important;
}
</style>
</b:if>

Note: Replace PAGE-URL-HERE with the url of the page where the search results will be displayed (the one you have added at the step 4)

Step 5. Now Save Template and you're done!

This simple trick allows you not only to hide the sidebar in the search results page, you can as well, hide it on any page you want... just create your page and follow the same steps. It is also recommended to hide the sidebar in Privacy Policy Pages, Contact Pages and on all the non-content-based pages with little content or no content at all.





- How To Add Static Pages To A Blogger Blog (updated)
A few months ago, Blogger has completely redesigned the section of the Pages, which now, looks very similar to that of the Blogger Posts. Now we will be able to manage the pages with more flexibility. For example, we can publish, delete or change many...

- The Difference Between White Hat Seo And Black Hat Seo
The search engine optimization (SEO) is a good chance to promote your blog on Google search results and other search engines. For those who don't understand how SEO works, I've posted some articles on this blog that may help, but it's important...

- Tips To Avoid Your Google Adsense Account From Getting Banned
As many of you already know, Google Adsense is the most popular and generous advertisment service from Google that gives you recurring income. However, some people don't bother to read the Adsense policies and they usually violate AdSense Terms and...

- Hide/show Widgets/gadgets In Home/post/static/archive Pages In Blogger
As some of you may have noticed, all the widgets/gadgets you add to your blog, will be displayed on all the pages by default, including the homepage as well. And I'm sure very few know that AdSense could disable your account in case you've put...

- How To Submit Your Blogger Sitemap To Google
What are Sitemaps? Sitemaps are text files containing a list of all web pages that exist on your website and are accessible to crawlers and users. These helps visitors and search engine bots to find pages on website. Sitemaps are a way to help Google...



Blogger Tips








.