Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.com

    Thanks
    Charlotte

    The 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>

    #633076

    Hey Charlotte! :)

    You can insert both codes in Text widget or Text element on text tab

    Best regards,
    Yigit

    #633100

    Hey :)

    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-test

    ALL 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>

    #633113

    Hey!

    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!
    Yigit

    #633604

    Thanks 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
    Charlotte

    #633669

    Hi,

    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,
    Yigit

    #633699

    Excellent, thanks Yigit :)

    #633703

    Hey!

    You are welcome Charlotte :) Let us know if you have any other questions or issues

    Cheers!
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Adding code – but where?’ is closed to new replies.