Tagged: x
-
AuthorPosts
-
July 19, 2016 at 6:19 am #1093292
Hello,
I am trying to add the Zopim chat widget to my child theme. I read through this support thread from two years ago but am still not clear on where to paste this Zopim code.
<!–Start of Zopim Live Chat Script–>
<script type=”text/javascript”>
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute(“charset”,”utf-8″);
$.src=”//v2.zopim.com/?44cpj4FdkiZGqSIFYsrorfcRmPiUxPHh”;z.t=+new Date;$.
type=”text/javascript”;e.parentNode.insertBefore($,e)})(document,”script”);
</script>
<!–End of Zopim Live Chat Script–>That thread says “If you are using a child theme, you can also add it directly in wp_head or wp_footer globally.” How do I get there? Can you give a simple explanation like Themes-> Appearance -> Editor then select theme to edit and where exactly to paste the code? The final step on the Zopim support page says it should be pasted in the Footer section before the </body> tag, but I don’t see a Footer section in the Child theme under Editor. Am I supposed to paste it in the Footer of the X parent?
Finally, the second step in the Themeco reply in the above mentioned X support thread said “you just have to add this code below in your child theme functions.php file and it will be added across all your pages in footer. Is that still correct? Do I need to paste the following code to the child theme functions.php file?
function global_zop_script() { ?>
<!–-Your Zopim Chat code below this line-–>
<?php
}
add_action(‘wp_footer’,’global_zop_script’);I am attaching a screenshot of my child theme functions page. If this is the correct page, where exactly do I paste that code?
Thanks for any feedback you can provide.
Patrick
July 19, 2016 at 7:11 am #1093353Hi there,
Thanks for writing in! Follow the last bit of code above starting from (
function global_zop_script() { ?>
) and replace<!–-Your Zopim Chat code below this line-–>
with your Zopim script.You just have to edit the functions.php file within your child theme and place the code.
Hope that’s clear.
July 19, 2016 at 10:40 am #1093703This reply has been marked as private.July 19, 2016 at 11:03 am #1093745Hi there,
It seems to be correct. Let’s try that.
Cheers!
July 19, 2016 at 8:13 pm #1094510This reply has been marked as private.July 19, 2016 at 8:19 pm #1094516This reply has been marked as private.July 19, 2016 at 8:45 pm #1094619Problem solved. Apparently zopim now is completely integrated on the site just by activating the plugin, and you no longer have to update the .php files as well. I am pasting the answers from the zopim chat support who, like Themeco support, were very helpful. Thank you!
Oh I see. We have 2 ways on how you can install the widget via WordPress. Either by plug in or the Appearance Menu. Here’s the guide that you can follow on how to do just that:
https://zopimsupport.zendesk.com/hc/en-us/articles/212020688
If you want to use the plug-in over installing it manually via the Appearance page, you can get the latest version here on this page: https://wordpress.org/plugins/zopim-live-chat/
July 20, 2016 at 1:16 am #1094834Glad to hear that you were able to fix it.
-
AuthorPosts