• Hi, I would like to add Agoda search Box to my site, the code is Javascript

    <div id="xxx"></div>
    <script type="text/javascript" src="//cdn0.agoda.net/images/sherpa/js/sherpa_init1_08.min.js"></script><script type="text/javascript">
    var stg = new Object(); stg.crt="xxx";stg.version="1.04"; stg.id=stg.name="adgshp2089682027"; stg.width="388px"; stg.height="511px";stg.ReferenceKey="xxx/qwEpJvb7Qg=="; stg.Layout="SquareCalendar"; stg.Language="en-us";stg.Cid="xxx"; stg.DestinationName="";stg.OverideConf=false; new AgdSherpa(stg).initialize();
    </script>
    --

    can you please tell me what is the best way to add this code, I tried with the text editor and shortcode but its didnt work that good, the search box didnt load all the times…

    I want to create few tabs in my Home page and in on of them to add Agoda search box…

    thanks for your help

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Inserting via shortcode is generally a good solution if it is to occur only on specific pages. If it works only some of the time, there may be interference from other scripts running, in which case inserting by other means may not help any.

    You could add the code directly to a theme template. Perhaps footer.php if it is intended for all pages. Or a specific page template if intended for specific pages. Success depends on how the JS is implemented.

    When you wish to alter theme templates, it’s recommended you create a child theme. Otherwise your custom work will be overwritten during theme updates.

Viewing 1 replies (of 1 total)

The topic ‘Add a Javascript to my page’ is closed to new replies.