integrating google search with wordpress template

Discussion in 'HTML & Website Design' started by sandrodz, Dec 10, 2009.

  1. #1
    sounds easy ha? but not so easy... problem is the design, I don't want to use google design, I would like to have my own like in the theme...

    So basically, I need to merge this two things:

    from word press searchform.php (this is designd search form, I want to keep it like this):

    <form id="searchform" method="get" action="<?php bloginfo('home'); ?>/" ><input type="text" value="<?php _e("enter search terms ..."); ?>" onfocus="if (this.value == '<?php _e("enter search terms ..."); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("enter search terms ..."); ?>';}" size="18" maxlength="50" name="s" id="searchfield" /><input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/blank.gif" id="submitbutton" alt="<?php _e("go"); ?>" /></form>
    Code (markup):
    and I want the functionality of this google search form:

    <form action="http://www.sandrophoto.com/index.php?" id="cse-search-box">
      <div>
        <input type="hidden" name="cx" value="016435508704770331466:w8nheyevh8w" />
        <input type="hidden" name="cof" value="FORID:11" />
        <input type="hidden" name="ie" value="UTF-8" />
        <input type="text" name="q" size="31" />
        <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>
    Code (markup):

    Question is, how do I integrate these two?? anyone?
     
    sandrodz, Dec 10, 2009 IP
  2. sandrodz

    sandrodz Peon

    Messages:
    1,482
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    is it so tough?? :) come on guyz someone must have experience doing these things...
     
    sandrodz, Dec 10, 2009 IP
  3. skystudio

    skystudio Well-Known Member

    Messages:
    241
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
  4. wounded1987

    wounded1987 Well-Known Member

    Messages:
    2,914
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    150
    #4
    <form action="http://www.sandrophoto.com/index.php?" id="searchform">
    <div>
    <input type="hidden" name="cx" value="016435508704770331466:w8nheyevh8w" />
    <input type="hidden" name="cof" value="FORID:11" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" value="<?php _e("enter search terms ..."); ?>" onfocus="if (this.value == '<?php _e("enter search terms ..."); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("enter search terms ..."); ?>';}" name="q" size="18" maxlength="50" id="searchfield"/>
    <input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/blank.gif" id="submitbutton" alt="<?php _e("go"); ?>" name="sa" />
    </div>
    </form>
    <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>

    try this.
     
    wounded1987, Dec 11, 2009 IP
    sandrodz likes this.