-
AuthorPosts
-
October 5, 2017 at 1:40 pm #860583
I have a website where I have to insert a booking widget. http://woodstock-guesthouse.co.uk/
The coding below works fine in a widget in a footer, but won’t work in a widget or code black on the page itself. One entered, the code won’t allow the page to load.
Whey does the code work OK in a footer and not on the page?
Thanks,
Nigel.<div id=”f2b-widget”><script src=”https://www.freetobook.com/affiliates/dynamicWidget/js/widget-js.php?w_id=29374&w_tkn=JUOBZOGBL1lXStXEM0T4FwqGYwJ4BZeGlEsNtLCnzg0Q3JmO2mbFgwh5VLlGh” type=”text/javascript”></script></div>
October 6, 2017 at 7:01 am #860873Hey nigelpengelly,
Thanks for the login details, on what page can we see the problem?
Best regards,
RikardOctober 6, 2017 at 10:47 am #860932This is the website: http://woodstock-guesthouse.co.uk/
I’ve taken the code block and widget area off the the homepage.
The widget block used to be in the content area next to Testimonials on the home page.
I’ve tried the coding on other WordPress themes, and it works fine.
Since I added the widget, and taken it off – the website is loading really slow.
It seems to load in Safari, yet not Chrome.October 7, 2017 at 5:51 am #861305Hi,
Ok, thanks for the feedback. Maybe you could create a test page where we can inspect the issue?
Best regards,
RikardOctober 9, 2017 at 5:38 pm #862007Rikard,
Here is a test page with the widget and coding: http://woodstock-guesthouse.co.uk/test-page/
Thanks,
Nigel.
October 9, 2017 at 5:40 pm #862008Sorry, one more question – is it possible to put a widget area in the top menu?
October 11, 2017 at 2:11 pm #862881This reply has been marked as private.October 12, 2017 at 4:40 am #863123Hi,
In a code block, just add the following html.
<div id="f2b-widget"></div>
And then enqueue the script in the functions.php file separately.
function ava_wp_enqueue_scripts_112323432432() { wp_enqueue_script( 'script-name', 'https://www.freetobook.com/affiliates/dynamicWidget/js/widget-js.php?w_id=29374&w_tkn=JUOBZOGBL1lXStXEM0T4FwqGYwJ4BZeGlEsNtLCnzg0Q3JmO2mbFgwh5VLlGh', array(), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'ava_wp_enqueue_scripts_112323432432' );
Best regards,
IsmaelOctober 12, 2017 at 5:35 pm #863549This reply has been marked as private.October 13, 2017 at 12:19 pm #863891I think I’ve worked out how to add a widget to the header area: http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/
Is the info from the link above correct?
October 13, 2017 at 12:52 pm #863907Hi,
Parse error: syntax error, unexpected ‘@’ in /var/sites/w/woodstock-guesthouse.co.uk/public_html/wp-content/themes/enfold/functions.php on line 573
Would you be able to enter the script for me?Please copy the code directly from the forum, not from your email. The syntax was probably invalid.
Is the info from the link above correct?
Yes, you can use that hook to add a widget or any elements inside the header area.
Best regards,
IsmaelOctober 13, 2017 at 1:01 pm #863920Ismael,
I did – I pasted the below at the end of the functions.php file and it broke the website:function ava_wp_enqueue_scripts_112323432432() {
wp_enqueue_script( ‘script-name’, ‘https://www.freetobook.com/affiliates/dynamicWidget/js/widget-js.php?w_id=29374&w_tkn=JUOBZOGBL1lXStXEM0T4FwqGYwJ4BZeGlEsNtLCnzg0Q3JmO2mbFgwh5VLlGh’, array(), ‘1.0.0’, true );
}
add_action( ‘wp_enqueue_scripts’, ‘ava_wp_enqueue_scripts_112323432432’ );What else can you suggest?
Nigel.
October 15, 2017 at 5:17 am #864401 -
AuthorPosts
- You must be logged in to reply to this topic.