View Full Version : How to add custom search engine???
mytechguru
05-12-2008, 04:13 PM
Hi,
I loved the theme super .. excellent. me installed theme @ my local PC just testing the theme @ local PC. i got problem while adding custom search engine code @ header File.
may anyone help me out
Regards
Kiran
Kevin
05-12-2008, 05:51 PM
Hi Kiran,
What custom search code are you adding. Do you mean a search box to search your blog or do you mean an external search box like google or whatever
Regardless, it shouldn't be too hard to fix so give me some more details about your blog and I'll do my best to help :)
mytechguru
05-13-2008, 02:06 AM
Hi Kevin,
Thanks for relying my thread. i mean to say Google custom search engine code http://www.google.com/coop/cse/
to be inserted under header.php file.
Theme: Blogging Tips Evolution Theme
If v need edit the font v need edit the default style sheet na ???????
regards
Kiran
Kevin
05-13-2008, 01:48 PM
Well, I assume search results are on googles server so it should be just a matter of placing the search box somewhere on your blog. The sidebar is probably the best place to put it in my opinion.
Open up sidebar.php and place it where you want :)
mytechguru
05-14-2008, 02:35 AM
Thanks for Relying my thread. i just uploaded one snap shout in attachment section. plz have a look. i mean to say Google custom search engine box code at header file.
Kevin
05-14-2008, 10:40 AM
right I've got you now.
post the code for the search engine and I'll try and fit it in the current design for you
mytechguru
05-14-2008, 06:01 PM
Hear is the Code
<form action="http://www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="009362889185095370220:iivnc3jfns4" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="text" name="q" size="25" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
:)
Kevin
05-14-2008, 07:17 PM
ok,
heres a quick fix
add this class to your stylesheet (default-blue.css or whatever)
.search-right {
float:right;
}
then add your search code just after your page listings in the header.php file
so you would replace
<ul class="menu">
<li class="page_item page_item_1 <?php if ( is_home() ) { ?>current_page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a></li>
<?php wp_list_pages('title_li=&depth=1' ); ?>
</ul>with
<ul class="menu">
<li class="page_item page_item_1 <?php if ( is_home() ) { ?>current_page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a></li>
<?php wp_list_pages('title_li=&depth=1' ); ?>
<span class="search-right">
<form action="http://www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="009362889185095370220:iivnc3jfns4" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="text" name="q" size="25" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
</span>
</ul>
mytechguru
05-15-2008, 03:23 AM
Thanks Sir for u r wonderful Tech Support
i have just added
.search-right {
float:right;
}
Below .container { tag. @ default-blue.css style sheet.
It is working Fine @ Mozilla Firefox. But @ Internet Explorer some problem i have a snap shout for u
Sir if we add the code in between Logo & Feed Burner E-Mail subscriber it may bee fine ??? @ header.php file ?.
Anyway Thanks For fixing the Problem :)
regards
Kiran
sarahG
05-15-2008, 07:32 AM
You may be better floating the menu left and then surrounding the search box with a div and floating that right, then they should stay on the same line. A float should also have a width (unless it's an image).
ie.
<ul class="menu">
<li class="page_item page_item_1 <?php if ( is_home() ) { ?>current_page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a></li>
<?php wp_list_pages('title_li=&depth=1' ); ?>
</ul>
<div class="search-right">
<form action="http://www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="009362889185095370220:iivnc3jfns4" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="text" name="q" size="25" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
</div>
then set your CSS as
ul#menu {
width: 60%;
float: left;
}
div.search-right {
width: 35%;
float: right;
}
You may need to play with your widths to get them to fit. Go by the width of the search box as that's the fixed width whereas you may add more pages in the future. Just make sure the two widths add u to either less than 100% or less than the full width of the site if you use pixels (sorry I'm not sure if it's a fixed or flexible width theme).
Because of the floats you may then need to add an additional clearing div below the markup else it could throw other elements out, if you do then insert
<div style="clear:both"></div>
Right after the closing div of the search box.
Kevin
05-15-2008, 01:23 PM
kiran - sorry, I had only checked it in firefox.
sarah - very nice fix. I originally tried to float it to the left and whatever I done, I completely messed it up! Thanks for the support :)
mytechguru
05-15-2008, 06:52 PM
Thanks Kevin & sarahG for the Wonderful tech support.
My problem Got Solved But me planed to have code[Search Box] in between[Middle] of Logo & Feed Burner E-Mail subscriber --It can make a Blog as Served Neat Look i feel so
sir any suggestion in this matter .u r support was amazing like a strategy
· Deliver on the basics.
vBulletin® v3.8.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.