When Google let users add AdSense for Search results on my own site, I tried to install it. I want to keep elements like the header, footer, and site navigation panel the same for the search results page I create. You should try this new feature to your wordpress.
To use it, just choose the “Open results within my own site” radio button when you’re generating your AdSense for search code. You’ll also need to identify the page where you’d like to display your search results.
Google will give you two sets of code: one for the search box, and one for search results. Place the first set on a page where you’d like the search box to appear, and the second set on the page you’d like the search results to appear. Whenever users perform searches on your AdSense for search box, they’ll be directed to the page on which you placed the search results code.
It’s sound so easy. I just tried it and I couldn?t get it to work on my blog 🙁 What is wrong? Therefore, I search to find the solution of my problem. I get a solution from macstansbury for my problem. Thanks for your tutorial.
Here are steps to install Google AdSense for Search on WordPress:
- Create a new page named “Search Results,” or something similar.
- Put your search box code in your sidebar or wherever you decide. I put this code in searchform.php and call this function on my sidebar.
- Set up the search to point to the page your created.
- After you put the Search code where you want it, do a search for anything.
- Create a new page template in your theme folder. The theme would start with this as the first line:
<?php /* Template Name: Google Search */ ?>
Feel free to named this template.
- Upload this to your theme folder in a moment, after you’ve titled the file googlesearch.php and saved it.
- Save your googlesearch.php file, then upload it in the same folder as the theme you’re using right now.
- Go into edit your search results page and change the Page Template to “Google Search” (or whatever you named the template) and save the page.
- Well done! You’ll get get the results I get!
Try search something on my blog just for test.
😀 Gud lak