User | Post |
2:17 pm December 20, 2011
| Eric – PersonalProfitability.com
| | Portland, OR | |
| Member
| posts 2120 |
|
|
|
I just added back a Google Custom Search (AdSense Search) box on my site. I put it above the sidebar using Thesis Hooks, but I want to place it in the side of my navbar where the Subscribe link currently is (I know how to remove that, it is a placeholder).
Any ideas?
|
|
|
5:52 pm December 20, 2011
| The College Investor
| | San Diego, CA | |
| Admin
| posts 1935 |
|
|
|
Try this. It is for Thesis search, but I'm sure you can modify it for Google Search.
remove_action('thesis_hook_before_header', 'thesis_nav_menu');add_action('thesis_hook_after_header', 'thesis_nav_menu');
function add_search_nav() { ?> <li class="search"><?php thesis_search_form(); ?></li><?php }
add_action('thesis_hook_last_nav_item','add_search_nav');
|
|
|
8:51 am December 21, 2011
| Eric – PersonalProfitability.com
| | Portland, OR | |
| Member
| posts 2120 |
|
|
|
I have this code in the Before Sidebar 1 hook with the Open Hooks plugin:
<form action="http://www.narrowbridge.net/results" id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-0128772486725372:svqi7brbp9c" /> <input type="hidden" name="cof" value="FORID:11" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" size="20" /> <input type="submit" name="sa" value="Search" /> </div></form><script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
If I drop that code into the bold part in Custom Functions will it work right?
remove_action('thesis_hook_before_header', 'thesis_nav_menu');add_action('thesis_hook_after_header', 'thesis_nav_menu');
function add_search_nav() { ?> <li class="search"><?php thesis_search_form(); ?></li><?php }
add_action('thesis_hook_last_nav_item','add_search_nav');
I don't want to kill my site by doing it wrong. Thanks.
|
|
|
12:25 pm December 21, 2011
| The College Investor
| | San Diego, CA | |
| Admin
| posts 1935 |
|
|
|
You need to make a custom function for the Googe Search. Here is what the Google Search custom function should look like:
function googly() {
?>
<div class="goog">
<form action="http://www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="value_for_my_site" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="31" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
</div>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
<?php
}
Then, you need to use the code above to add it to your Nav Bar. It won't kill your site. You may need to play with the CSS to make it look right though.
|
|
|
12:25 pm December 21, 2011
| The College Investor
| | San Diego, CA | |
| Admin
| posts 1935 |
|
|
|
DIY Forums have a lot of good info on this.
|
|
|
10:07 am December 27, 2011
| Eric – PersonalProfitability.com
| | Portland, OR | |
| Member
| posts 2120 |
|
|
|
Got it! Thanks. I have to Tweak the size of the input box a bit but it is now in the right place.
|
|
|