How can I add the Google custom search code to my page.

  • Unknown's avatar

    I want to add the Google search tool to my page: Here is the code. I tried to insert it between <div>elements on http://mpnforum.com/six-clinics-index/ . No luck.

    (function() {
    var cx = ‘014764052633138120760:e52qldwxsdi’;
    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);
    })();

    </div>

    The blog I need help with is: (visible only to logged in users)

  • Hi there, it won’t be possible to add that code since we don’t allow JavaScript for security reasons. You can read more about the types of code that are permitted on WordPress.com sites.

    Depending what your trying to achieve, a workaround might be to a link to a standalone document hosted elsewhere.

    Just let me know if you need further help.

  • The topic ‘How can I add the Google custom search code to my page.’ is closed to new replies.