-
AuthorPosts
-
May 16, 2016 at 1:36 pm #632910
Hey,
I am going to add a widget and the website for the widgets says I should first enter this code
“To load and display the GetYourGuide Widget your page should include two parts: an HTML element the widget will be inserted into and an HTML script element that runs the widget with your preferred configuration.”<!– HTML element the widget will be inserted into –>
<div id=”gyg-widget”></div><!– HTML script element that runs the widget –>
<script async defer src=”//widget.getyourguide.com/v2/core.js” onload=”GYG.Widget(document.getElementById(‘gyg-widget’),{‘q’:’Paris’});”></script>I tried to enter it in the functions.php file but that created an error on the main page.
Any idea where I can add this code?
http://www.airlinestaffrates.comThanks
CharlotteThe second code should be enter into a widget or I guess a text element would be fine as well.
<div id=”gyg-widget”></div><script async defer src=”//widget.getyourguide.com/v2/core.js” onload=”GYG.Widget(document.getElementById(‘gyg-widget’),{‘currency’:’EUR’,’iata’:’AMS’,’numberOfItems’:’3′,’partnerId’:’2065C5D’,’q’:’Amsterdam’,’type’:’tour’});”></script>
May 16, 2016 at 4:08 pm #633076Hey Charlotte! :)
You can insert both codes in Text widget or Text element on text tab
Best regards,
YigitMay 16, 2016 at 4:22 pm #633100Hey :)
It work the first time I enter the code but when I just change the city the last part of the code disappears..
http://www.airlinestaffrates.com/ams-testALL OF THE CODE
<!– HTML element the widget will be inserted into –>
<div id=”gyg-widget”></div><!– HTML script element that runs the widget –>
<script async defer src=”//widget.getyourguide.com/v2/core.js” onload=”GYG.Widget(document.getElementById(‘gyg-widget’),{‘q’:’Amsterdam’});”></script><div id=”gyg-widget”></div><script async defer src=”//widget.getyourguide.com/v2/core.js” onload=”GYG.Widget(document.getElementById(‘gyg-widget’),{‘currency’:’EUR’,’iata’:’AMS’,’numberOfItems’:’6′,’partnerId’:’2065C5D’,’q’:’Amsterdam’,’type’:’tour’});”></script>
AFTER I SAVE THE PAGE
<!– HTML element the widget will be inserted into –>
<div id=”gyg-widget”></div>
<!– HTML script element that runs the widget –>
<script src=”//widget.getyourguide.com/v2/core.js” async=”” defer=”defer”>// <![CDATA[
</div><script async defer src=”//widget.getyourguide.com/v2/core.js” onload=”GYG.Widget(document.getElementById(‘gyg-widget’),{‘currency’:’EUR’,’iata’:’AMS’,’numberOfItems’:’6′,’partnerId’:’2065C5D’,’q’:’Amsterdam’,’type’:’tour’});”>
// ]]></script>May 16, 2016 at 4:33 pm #633113Hey!
Please add following code to Functions.php file in Appearance > Editor
function remove_title_attr(){ ?> <script async defer src="//widget.getyourguide.com/v2/core.js" onload="GYG.Widget(document.getElementById('gyg-widget'),{'currency':'EUR','iata':'AMS','numberOfItems':'6','partnerId':'2065C5D','q':'Amsterdam','type':'tour'});"></script> <?php } add_action('wp_footer', 'remove_title_attr');
and then add following to Text Block element
<div id="gyg-widget"></div>
Would you need to add the code for multiple cities? :)
Cheers!
YigitMay 17, 2016 at 10:36 am #633604Thanks Yigit :)
That worked fine.I guess I just change AMS to the relevant city, right?
I have added the code here now: http://www.airlinestaffrates.com
Scroll down a bit.What code do I need to add in order to adjust the Get your Guide deals to be align in height with the Hotel deals?
Also add some space between them.Thanks
CharlotteMay 17, 2016 at 12:18 pm #633669Hi,
Please try adding this code to the Quick CSS section under Enfold > General Styling or to your child themes style.css file:
#gyg-widget { margin-left: 15px; }
and then adjust the height attributes of your guide deals and change it from 400px to 530px
Best regards,
YigitMay 17, 2016 at 12:43 pm #633699Excellent, thanks Yigit :)
May 17, 2016 at 12:48 pm #633703 -
AuthorPosts
- The topic ‘Adding code – but where?’ is closed to new replies.