Title: Add Google CSE
Last modified: August 22, 2016

---

# Add Google CSE

 *  Resolved [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/)
 * I love the search snippet and how it puts it on the navbar. However I would like
   to use the “Google Custom Search Engine” there instead.
    Google gives a code 
   snippet which works as a widget, but would like to have it in my navbar on the
   bottom right. Can this be done without using a widget?

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272424)
 * Why not create a new [Widget Area](http://www.themesandco.com/snippet/add-widget-area-header/)
   and then reposition it with CSS?
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272433)
 * Not sure how to setup the widget so it shows in that location.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272437)
 * I remember a post about placing widgets just about anywhere but cannot find it.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272455)
 * what would be the HOOK to place it as a menu item? or to the bottom right of 
   the nav? I have managed to place it EVERYWHERE except where I want it.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272458)
 * OK got it where I wanted it, but it is overwriting my 2nd line on my tagline.
   How do I fix that? It also killed my menu.
    Here is what I used. [SITE LINK](http://youneedthissite.com/site6)
 * > add_filter (‘wp_nav_menu_items’, ‘add_my_widget’);
   >  function add_my_widget(){
   > if (function_exists(‘dynamic_sidebar’)) { dynamic_sidebar(‘Extra Widget After
   > Navbar’); } }
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272463)
 * I took it off..
 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272464)
 * I was suggesting CSS:
 *     ```
       .gsc-control-cse {
         position: absolute;
         top: 20px;
         z-index: 500;
       }
       ```
   
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272466)
 * OK added the css snippet, now its weird. putting a searchbox on top of the navbar.
   I added _after as it was placing 2 searchboxes and killing the menu. I have the
   menu back.
    Here is what I have now.
 * > add_filter (‘_after_wp_nav_menu_items’, ‘add_my_widget’);
   >  function add_my_widget(){
   > if (function_exists(‘dynamic_sidebar’)) { dynamic_sidebar(‘Extra Widget After
   > Navbar’); } }
 *  [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * (@electricfeet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272477)
 * Tha looks like code that will place a widget area, but you need to have defined
   it first. See this snippet for an explanation: [http://www.themesandco.com/snippet/add-widget-area-header/](http://www.themesandco.com/snippet/add-widget-area-header/)
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272490)
 * That is where I started. I have tried using a widget which does work with the
   Google snippet, but I just cannot seem to get it to show where I want it.
    **
   Back to the original question:** I have a html snip from google, where should
   I place it using a div and then is there any way to use the [SEARCH SNIPPET](http://www.themesandco.com/snippet/adding-an-html5-search-form-in-your-wordpress-menu/)
   to add it to my menu?
 *  [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * (@electricfeet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272565)
 * What is the Google code that you are trying to place? Could you paste it here?
   But **_use backticks_** (the code button will insert the character if you don’t
   have it on your keyboard).
 *  [The_Trucker](https://wordpress.org/support/users/the_trucker/)
 * (@the_trucker)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272568)
 * Something happened to my login, it says I don’t exist as “questas_admin” anymore.
   Anyway I am the same person. That being said, here is the google code I am trying
   to work.
 * > <script>
   >  (function() { var cx = ‘000594048061160289773:0fmxn8kcbd4’; var gcse
   > = document.createElement(‘script’); gcse.type = ‘text/javascript’; gcse.async
   > = true; gcse.src = (document.location.protocol == ‘https:’ ? ‘https:’ : ‘http:’)
   > + ‘//www.google.com/cse/cse.js?cx=’ + cx; var s = document.getElementsByTagName(‘
   > script’)[0]; s.parentNode.insertBefore(gcse, s); })(); </script>
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272569)
 * I figured out my WP login issue. The previous post was from me.
 *  [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * (@electricfeet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272586)
 * I think that what [this article](http://www.wpbeginner.com/wp-tutorials/how-to-add-google-search-in-a-wordpress-site/)
   is saying is that you _can_ use the search form snippet, if you create a _searchform.
   php_ file.
 * But I cannot make it work 🙁
 * I also tried adding the script instead of the `get_search_form()` function (and
   buffering it), but I couldn’t get that to work either.
 * Don’t know enough about javascript, I’m afraid.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272617)
 * That’s OK, I appreciate the help, I cannot get it to work either. Time to focus
   on something else.
 * Thanks

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Add Google CSE’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [niclook](https://wordpress.org/support/topic-tag/niclook/)

 * 15 replies
 * 4 participants
 * Last reply from: [David_G](https://wordpress.org/support/users/questas_admin/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/add-google-cse/#post-5272617)
 * Status: resolved