Jump to content
Sign in to follow this  
sponzertgmailcom

How to get AdSense for Search into search box.

Recommended Posts

sponzertgmailcom

Hi, I would like to use AdSense for Search and would like to display it into the original search box, not an widget search. How can i implement this?

Share this post


Link to post
Share on other sites
cmunns

At the bottom of _posts.php is where the 404 / search code is controlled. ` <?php if(is_404()):?>

<?php _e('Error 404 - Page Not Found',TDOMAIN);?>

<?php else:?>

<?php _e('Nothing Found',TDOMAIN);?>

<?php endif;?>

<?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?>

<?php get_search_form(); ?>

Share this post


Link to post
Share on other sites
sponzertgmailcom

Thank you cmunns So if i remove that part and replace it with the adsense code it should work?

Share this post


Link to post
Share on other sites
cmunns

I'm not exactly sure to be honest, because I don't know what you mean by use adsense for search. Is it placed on the search page? or do you implement a separate search bar that uses adsense? Did you try experimenting a little on placing the code?

Share this post


Link to post
Share on other sites
sponzertgmailcom

Take a look ad my site and the seach widget. Thats what i would like to have in the top menu. This code needs to get implemented. The xxxxx are my accountnumber ;) <script type="text/javascript"><!-- google_ad_client = "pub-9439008643746641"; /* 250x250, gemaakt 26-8-10 */ google_ad_slot = "XXXXXXXXXXXXX"; google_ad_width = 250; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

Share this post


Link to post
Share on other sites
cmunns

Hey Rinus, How can I see your site. There is no link in this thread? Did you try placing the code right above that first `

` tag?

Share this post


Link to post
Share on other sites
sponzertgmailcom

Sorry, this is my site. I just tried that and it does nothing. BTW When you look ad my site you see a Adsense widget on the right side. Its just an empty widget with some code in it. Its not centered, can you tell me how to center this add?

Share this post


Link to post
Share on other sites
cmunns

To center it you can try this CSS `#sidebar .textwidget {text-align:center;}` just watch to make sure it doesn't center other widgets that are not supposed to be centered. I think you're using the code incorrectly, although I'm no expert with Adsense. I believe a portion of that script has to go in the header (meaning before the HTML of the page) and the other portion goes in the actual page, also it supposed to be commented out?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×