WordPress.org

Ready to get started?Download WordPress

Forums

Google Custom Search Displaying Code Instead of Search Results (2 posts)

  1. jimbomack66
    Member
    Posted 4 years ago #

    I want to add a Google Custom Search box in the far right of my top "Nav" menu and display search results in a new page.

    I created a new page in my WP admin called "Search Results", and copied the code snippet provided by Google into the HTML editor of this newly created page, and I found some code at fourblogger.com that will position the Google Custom Search box in my Nav menu.

    The problem is that following code (pasted into the HTML editor of my "Search Results" page) is displayed in the search results instead of the search results.

    var googleSearchIframeName = “cse-search-results”;
    var googleSearchFormName = “cse-search-box”;
    var googleSearchFrameWidth = 600;
    var googleSearchDomain = “www.google.com”;
    var googleSearchPath = “/cse”;

    Can anybody offer any advice on how to get my search results to display rather than the code?

    FYI, I’ve removed the search box code from my blog until I get my problem figured out.

    Thank you.

  2. edwinkwan
    Member
    Posted 3 years ago #

    Hi jimbomack66,

    There's a plugin which allows you to do this.

    And its very easy to use too!

    http://wordpress.org/extend/plugins/google-custom-search/

Topic Closed

This topic has been closed to new replies.

About this Topic