Viewing 3 replies - 1 through 3 (of 3 total)
  • Put this code into your header.php file & into <head> </head> seciton

    <script type=”text/javascript>
    javascript:void($zopim.livechat.window.openPopout())
    </script>

    Thread Starter vieradel

    (@vieradel)

    I found this!

    I created a new file called olark.js and put this code in it:

    jQuery(document).ready(function($) {
        $("#menu-item-38872").on("click", function(e){
              e.preventDefault();
              // olark code here
              olark('api.box.expand');
        });
    });

    Then, I enqueued the script in my functions.php with the following code:

    function olark_script() {
        wp_register_script( 'olark', get_stylesheet_directory_uri() . '/js/olark.js', array(), '1.0.0', true );
        wp_enqueue_script( 'olark' );
    }
    
    add_action( 'wp_enqueue_scripts', 'olark_script' );

    Thread Starter vieradel

    (@vieradel)

    Top says Olark, but I use it with:

    javascript:void($zopim.livechat.window.openPopout())

    jQuery(document).ready(function($) {
        $("#menu-item-38872").on("click", function(e){
              e.preventDefault();
              javascript:void($zopim.livechat.window.openPopout())
              olark('api.box.expand');
        });
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Zopim chat in wordpress menu.’ is closed to new replies.