Tagged: body
I am trying to add this code
<script type=”text/javascript”>
var _userway_config = {
account: ‘nYMqWNnani’
};
</script>
<script type=”text/javascript” src=”https://cdn.userway.org/widget.js”></script>
I looked for appearance editor but there is not one on this install for some reason how would I either add the appearance/editor or this code to my files?
Hey Jay,
Please try this in your functions.php file:
function add_userway_code(){
?>
YOUR CODE GOES HERE
<?php
}
add_action('wp_footer', 'add_userway_code');
Best regards,
Rikard
Unfortunately this caused a fatal error, This needs to be just before the /body perhaps putting in the footer was the issue.
Hi,
Did you add the code to the end of the functions.php file?
Best regards,
Jordan Shannon
Yes I did I tried both the child theme function.php and the enfold.
Hi not worth the time or trouble for a plugin that is ADA compliant I will check on another site of mine with the divi theme and see if it is the theme or the script causing the error. but basically not that worried about it at this time.
Can you try it this way in child-theme functions.php:
add_action( 'wp_enqueue_scripts', 'enqueue_userway_code' );
function enqueue_userway_code() {
wp_enqueue_script( 'userway', 'https://cdn.userway.org/widget.js' );
}
add_action('wp_footer', 'add_userway_code');
function add_userway_code(){
?>
<script type="text/javascript">
var _userway_config = { account: 'nYMqWNnani'};
</script>
<?php
}