Showing wordpress widget on specific pages

Answered

3 Comments

  • Ramin Shokrizadeh
    Comment actions Permalink

    Hi Jeffrey,

    This can be done but not using our Wordpress plugin. You will need to follow these steps:

    1. In your Zopim dashboard, go to the widget settings and click the checkbox called "Turn off Chat Widget". https://dashboard.zopim.com/#widget/settings

    We are doing this so you can specify what pages the widget should be shown

    2. In Wordpress, install the following plugin (3rd party, not affiliated or supported by Zendesk/Zopim) that will allow you to easily add Javascript throughout the install or on specific posts/pages

    3. After the plugin is installed, go to the plugin's Global settings to add the following code in the section called "Scripts (end of the body tag)"

    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/?xIzCQPWMPryOA6s2YiYESTdiytPc2IUO";z.t=+new Date;$.
    type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");

    4. Now, go to the page you want the widget to appear on and click edit from the Wordpress nav. Once in the editor, click on 'Screen Options' to ensure that "Scripts n Styles" is checked


    5. Now that the plugin's panel appears on the page/post editor, you can add the following code to the second Script box

    $zopim(function() { 
    $zopim.livechat.button.show()();
    }); 



    This will tell the widget button to appear on this page. Once it appears for the visitor, it will be visible as they change pages unless you modify those pages to include the following code:

    $zopim(function() { 
    $zopim.livechat.hideAll();
    });

    Hope that helps you achieve what you want within the constraints of Wordpress.

    Thanks,

    Ramin

    0
  • aat bus
    Comment actions Permalink

    Hi Ramin,

     

    Thanks that the above post appear helpful to include chat only on a specific page.  However, I have checked that script n style plugin is no longer being developed or is broken.  Would you know any alternative plugin that will be easy to use so i could only show the chat on a specific page

    thank you

    Lyn

    0
  • Ramin Shokrizadeh
    Comment actions Permalink

    The last update for the plugin was two weeks ago: https://wordpress.org/plugins/scripts-n-styles/ and appears to be tested up to 4.8 which is the latest Wordpress version. There might be other options but this is the only one I am personally aware of.

     

    0

Please sign in to leave a comment.

Powered by Zendesk