Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Adding external Resdiary Script
New Landing › How can we help? › Atelier › Adding external Resdiary Script
- This topic has 14 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Atelier
-
July 11, 2016 at 10:08 pm #280567
Hi. Having issues adding external resdiary script into theme. Ive tested with default twentyfourteen theme and works ok.
Script just asks to add div to page, then scripts to end of body just before closing tag.
Ive tried this via, enqueue in functions file of child theme… via admin panel script injection, and via custom footer file in child theme… no luck to date.Script is :
<!-- Go to www.resdiary.com booking widget --> <div id="booking-widget-container"></div>
into the page.
Then (edited for security)
<script type="text/javascript"> var booking_deploy = ''; var booking_channel = 'online'; var booking_restaurant_id = '***'; var booking_theme = '***'; var booking_redirect = 'https://www.resdiary.com/Restaurant/----'; var booking_style = 'tall'; var booking_redirect_behavior = 'resdiary'; var booking_modal_theme = '***'; </script> <script src="https://bookwith.resdiary.com/booking/js/booking-mini-widget.js" type="text/javascript"></script>
I can see the div and code loading into source of page, So any ideas why this feature is not working within the theme?
Thanks, John.
July 12, 2016 at 7:37 am #280613Hi,
Please open to edit the functions.php file of child theme and put your given below of code.<?php function add_this_script_footer(){ ?> <!-- Go to www.resdiary.com booking widget --> <div id="booking-widget-container"></div> <script type="text/javascript"> var booking_deploy = ''; var booking_channel = 'online'; var booking_restaurant_id = '***'; var booking_theme = '***'; var booking_redirect = 'https://www.resdiary.com/Restaurant/----'; var booking_style = 'tall'; var booking_redirect_behavior = 'resdiary'; var booking_modal_theme = '***'; </script> <script src="https://bookwith.resdiary.com/booking/js/booking-mini-widget.js" type="text/javascript"></script> <?php } add_action('wp_footer', 'add_this_script_footer'); ?>
Thanks 🙂
MohammadJuly 12, 2016 at 10:00 am #280667Hi, yes I had tried this before, and now have your code in the child theme. You can see it loading correctly into the page, and also the DIV to display this within page content, but still not working on the page.
I cant seem to find any obvious errors within Firebug. As mentioned, the code works in default wordpress theme.
Would you have any other ideas please?July 12, 2016 at 10:41 am #280686Hi,
Please provide me login detail to check and resolve the issue.
Thanks
MohammadJuly 12, 2016 at 10:45 am #280689This reply has been marked as private.July 12, 2016 at 10:57 am #280698Hi,
What does this code?
Thanks
MohammadJuly 12, 2016 at 11:01 am #280699This reply has been marked as private.July 12, 2016 at 1:56 pm #280747Hi,
You should add this code at footer.php of theme just after this code<?php wp_footer(); ?>
.
Thanks
MohammadJuly 12, 2016 at 2:29 pm #280754Hi Mohammad,
I appreciate your time to support this, however we are not really making progress.Ive mentioned in my first post that Ive already tried to enqueue the script, then also add to the footer file. Ive even tried via Admin JS Box.
Either way I can get the script loading on the page, and showing in source code…. however I cannot get it to work in this theme, but it does in the default wordpress themes.
And Firebug does not show any specific script errors or anything on the page… so Im stumped as to why the ATELIER Theme would have this problem?
Are you also wondering what the issue is? Please check the page.. you will see the scripts loading in, and the div its supposed to load into on the page.July 13, 2016 at 11:25 am #280957Hello,
This issue lies someone in the theme, or swift composer as the code works in default HTML page, as it does also in Default WordPress Themes.So can you help tell me why it doesn’t work in Atelier please?
July 13, 2016 at 2:00 pm #281005Hi,
There are many scripts are loading double through your code. While it should load one time that is done by theme but your code load it again without check. That is cause to issue.
Thanks
MohammadJuly 13, 2016 at 2:02 pm #281006Thanks. That was not the issue,.. I was currently playing with the theme and had it loading in twice.
Ive loaded script in via an iframe and it’s working fine now.Thanks for your time. It’s obviously an issue with this theme and script conflict in some way.
July 13, 2016 at 2:19 pm #281013Hi,
I am glad that you managed to resolve the issue.
Thanks
MohammadJuly 14, 2016 at 10:41 am #281200Just out of interest, why would Atelier react like this… so the only way the external script works is to have it in an i-frame (which is not great for us).
Ive tested again and there seems nothing I can do to get this script working within atelier theme (without the iframe method).
I can see script in page code sucessfully, but it will not trigger and display in the page.Please tell me why this is? Its the first problem Ive had with such a great theme.
July 15, 2016 at 2:16 pm #281547Hi,
I am not 100% sure, there would appear to be no JS errors visible which would make it hard to debug.
Do you have any server settings/security plugins blocking the loading of external domain resources?
Thanks,
David. -
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.