-
AuthorPosts
-
October 1, 2014 at 11:47 pm #328561
Hello,
I would like to create a page with elements of the page “Google Immobilier” and that update automatically.
I have the code but i don’t know how i must do…I must create 1 div and put the code in “head”
See the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Hello World - Google Web Search API Sample</title> <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script language="Javascript" type="text/javascript"> //<! google.load('search', '1'); function OnLoad() { // Create a search control var searchControl = new google.search.SearchControl(); // Add in a full set of searchers var localSearch = new google.search.LocalSearch(); searchControl.addSearcher(localSearch); searchControl.addSearcher(new google.search.WebSearch()); searchControl.addSearcher(new google.search.VideoSearch()); searchControl.addSearcher(new google.search.BlogSearch()); searchControl.addSearcher(new google.search.NewsSearch()); searchControl.addSearcher(new google.search.ImageSearch()); searchControl.addSearcher(new google.search.BookSearch()); searchControl.addSearcher(new google.search.PatentSearch()); // Set the Local Search center point localSearch.setCenterPoint("New York, NY"); // tell the searcher to draw itself and tell it where to attach searchControl.draw(document.getElementById("searchcontrol")); // execute an inital search searchControl.execute("IMMOBILIER"); } google.setOnLoadCallback(OnLoad); //]]> </script> </head> <body> <div id="searchcontrol">Loading</div> </body> </html>
Can you help me… I’m lost!!!
Thanks.
Phil.October 2, 2014 at 9:52 am #328786Hey SPOONIX!
Thank you for using Enfold.
I’m sorry but we don’t provide support for third party scripts. However, you can edit header.php or try adding this on functions.php to place the script inside the head tag:
function googleimo_code() { ?> <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script language="Javascript" type="text/javascript"> //<! google.load('search', '1'); function OnLoad() { // Create a search control var searchControl = new google.search.SearchControl(); // Add in a full set of searchers var localSearch = new google.search.LocalSearch(); searchControl.addSearcher(localSearch); searchControl.addSearcher(new google.search.WebSearch()); searchControl.addSearcher(new google.search.VideoSearch()); searchControl.addSearcher(new google.search.BlogSearch()); searchControl.addSearcher(new google.search.NewsSearch()); searchControl.addSearcher(new google.search.ImageSearch()); searchControl.addSearcher(new google.search.BookSearch()); searchControl.addSearcher(new google.search.PatentSearch()); // Set the Local Search center point localSearch.setCenterPoint("New York, NY"); // tell the searcher to draw itself and tell it where to attach searchControl.draw(document.getElementById("searchcontrol")); // execute an inital search searchControl.execute("IMMOBILIER"); } google.setOnLoadCallback(OnLoad); //]]> </script> <?php } add_action('wp_head', 'googleimo_code', 10);
Place the div in header.php.
Regards,
IsmaelOctober 2, 2014 at 2:13 pm #328944Hello,
1- “Place the div n header.php.”: I don’t understand “div n”???
2- “you can edit header.php”: which header.php??? In “wp-content/themes” or in “wp-includes”?
3- Same question with file “functions.php”?
4- How can i do to place this script just for 1 page like “ndd.com/news”?Thanks for your help.
Phil.October 3, 2014 at 7:15 am #329489Hey!
This is something that requires custom work, please contact a developer to help you out, you can find reliable WordPress specialists here.
Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.